{"html_url": "https://github.com/simonw/datasette/issues/749#issuecomment-737580084", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/749", "id": 737580084, "node_id": "MDEyOklzc3VlQ29tbWVudDczNzU4MDA4NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T00:31:14Z", "updated_at": "2020-12-03T00:31:14Z", "author_association": "OWNER", "body": "This works!\r\n\r\n```\r\n/tmp % wget 'https://covid-19.datasettes.com/covid.db'\r\n--2020-12-02 16:28:02-- https://covid-19.datasettes.com/covid.db\r\nResolving covid-19.datasettes.com (covid-19.datasettes.com)... 172.217.5.83\r\nConnecting to covid-19.datasettes.com (covid-19.datasettes.com)|172.217.5.83|:443... connected.\r\nHTTP request sent, awaiting response... 200 OK\r\nLength: unspecified [application/octet-stream]\r\nSaving to: \u2018covid.db\u2019\r\n\r\ncovid.db [ <=> ] 306.42M 3.27MB/s in 98s \r\n\r\n2020-12-02 16:29:40 (3.13 MB/s) - \u2018covid.db\u2019 saved [321306624]\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 610829227, "label": "Cloud Run fails to serve database files larger than 32MB"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1122#issuecomment-737580813", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1122", "id": 737580813, "node_id": "MDEyOklzc3VlQ29tbWVudDczNzU4MDgxMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T00:33:09Z", "updated_at": "2020-12-03T00:33:09Z", "author_association": "OWNER", "body": "This is a very neat fix, thank you.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 754179035, "label": "Fix misaligned table actions cog"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1100#issuecomment-737581719", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1100", "id": 737581719, "node_id": "MDEyOklzc3VlQ29tbWVudDczNzU4MTcxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T00:35:23Z", "updated_at": "2020-12-03T00:35:23Z", "author_association": "OWNER", "body": "Replicated this against the live demo as well:\r\n```\r\n/tmp % curl -XOPTIONS https://latest.datasette.io/fixtures.json\r\n{\"ok\": false, \"error\": \"object Response can't be used in 'await' expression\", \"status\": 500, \"title\": null}% /tmp % \r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 747702144, "label": "Error on OPTIONS request to database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1123#issuecomment-737586248", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1123", "id": 737586248, "node_id": "MDEyOklzc3VlQ29tbWVudDczNzU4NjI0OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T00:47:37Z", "updated_at": "2020-12-03T00:47:37Z", "author_association": "OWNER", "body": "Affected tests:\r\n```\r\nFAILED tests/test_plugins.py::test_hook_table_actions[facetable] - AssertionE...\r\nFAILED tests/test_plugins.py::test_hook_table_actions[simple_view] - Assertio...\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 755721275, "label": "Table actions hook are order dependent, should not be"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1100#issuecomment-737589314", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1100", "id": 737589314, "node_id": "MDEyOklzc3VlQ29tbWVudDczNzU4OTMxNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T00:57:35Z", "updated_at": "2020-12-03T00:57:35Z", "author_association": "OWNER", "body": "Fixed in the demo:\r\n```\r\n% curl -XOPTIONS https://latest.datasette.io/fixtures.json\r\nok%\r\n```\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 747702144, "label": "Error on OPTIONS request to database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1121#issuecomment-737591281", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1121", "id": 737591281, "node_id": "MDEyOklzc3VlQ29tbWVudDczNzU5MTI4MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T01:03:18Z", "updated_at": "2020-12-03T01:03:18Z", "author_association": "OWNER", "body": "Demo: https://latest.datasette.io/fixtures?_bot=1\r\n\r\n\"fixtures\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 754178780, "label": "Table actions cog is misaligned"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1124#issuecomment-738209642", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1124", "id": 738209642, "node_id": "MDEyOklzc3VlQ29tbWVudDczODIwOTY0Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T18:39:19Z", "updated_at": "2020-12-03T18:39:19Z", "author_association": "OWNER", "body": "The CSS files are in the expected location:\r\n```\r\n[ec2-user@ip-172-31-30-7 ~]$ find /home/ec2-user/.local/pipx/venvs/datasette | grep css\r\n/home/ec2-user/.local/pipx/venvs/datasette/lib/python3.7/site-packages/datasette/static/app.css\r\n/home/ec2-user/.local/pipx/venvs/datasette/lib/python3.7/site-packages/datasette/static/codemirror-5.57.0.min.css\r\n```\r\nWow it's running an ANCIENT version of SQLite:\r\n```\r\n[ec2-user@ip-172-31-30-7 ~]$ datasette --get /-/versions.json\r\n{\"python\": {\"version\": \"3.7.9\", \"full\": \"3.7.9 (default, Aug 27 2020, 21:58:41) \\n[GCC 7.3.1 20180712 (Red Hat 7.3.1-9)]\"}, \"datasette\": {\"version\": \"0.52.2\"}, \"asgi\": \"3.0\", \"uvicorn\": \"0.12.3\", \"sqlite\": {\"version\": \"3.7.17\", \"fts_versions\": [\"FTS4\", \"FTS3\"], \"extensions\": {}, \"compile_options\": [\"DISABLE_DIRSYNC\", \"ENABLE_COLUMN_METADATA\", \"ENABLE_FTS3\", \"ENABLE_RTREE\", \"ENABLE_UNLOCK_NOTIFY\", \"SECURE_DELETE\", \"TEMP_STORE=1\", \"THREADSAFE=1\"]}}\r\n```\r\nhttp://www.sqlite.org/releaselog/3_7_17.html - SQLite Release 3.7.17 On 2013-05-20", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 756439516, "label": "Datasette on Amazon Linux on ARM returns 404 for static assets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1124#issuecomment-738211152", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1124", "id": 738211152, "node_id": "MDEyOklzc3VlQ29tbWVudDczODIxMTE1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T18:42:12Z", "updated_at": "2020-12-03T18:42:12Z", "author_association": "OWNER", "body": "Added a line to print out `app_root` from https://github.com/simonw/datasette/blob/e048791a9a2686f47d81a2c8aa88aa1966d82521/datasette/app.py#L848-L853\r\n```\r\napp_root = /home/ec2-user/.local/pipx/venvs/datasette/lib64/python3.7/site-packages\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 756439516, "label": "Datasette on Amazon Linux on ARM returns 404 for static assets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1124#issuecomment-738211776", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1124", "id": 738211776, "node_id": "MDEyOklzc3VlQ29tbWVudDczODIxMTc3Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T18:43:21Z", "updated_at": "2020-12-03T18:43:21Z", "author_association": "OWNER", "body": "I'm suspicious of this code here:https://github.com/simonw/datasette/blob/e048791a9a2686f47d81a2c8aa88aa1966d82521/datasette/utils/asgi.py#L284-L307", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 756439516, "label": "Datasette on Amazon Linux on ARM returns 404 for static assets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1124#issuecomment-738213342", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1124", "id": 738213342, "node_id": "MDEyOklzc3VlQ29tbWVudDczODIxMzM0Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T18:46:22Z", "updated_at": "2020-12-03T21:40:51Z", "author_association": "OWNER", "body": "I replaced that function with this code:\r\n```python\r\ndef asgi_static(root_path, chunk_size=4096, headers=None, content_type=None):\r\n async def inner_static(request, send):\r\n path = request.scope[\"url_route\"][\"kwargs\"][\"path\"]\r\n print(\"path =\", path)\r\n try:\r\n full_path = (Path(root_path) / path).resolve().absolute()\r\n except FileNotFoundError as e:\r\n print(\"FileNotFoundError:\", e)\r\n await asgi_send_html(send, \"404\", 404)\r\n return\r\n if full_path.is_dir():\r\n await asgi_send_html(send, \"403: Directory listing is not allowed\", 403)\r\n return\r\n # Ensure full_path is within root_path to avoid weird \"../\" tricks\r\n try:\r\n print(\"full_path={}, root_path={}\".format(full_path, root_path))\r\n full_path.relative_to(root_path)\r\n except ValueError as e:\r\n print(\" ValueError:\", e)\r\n await asgi_send_html(send, \"404\", 404)\r\n return\r\n try:\r\n await asgi_send_file(send, full_path, chunk_size=chunk_size)\r\n except FileNotFoundError:\r\n await asgi_send_html(send, \"404\", 404)\r\n return\r\n\r\n return inner_static\r\n```\r\nEdited using `vi /home/ec2-user/.local/pipx/venvs/datasette/lib/python3.7/site-packages/datasette/utils/asgi.py`\r\n\r\nThe output shows me what the bug is:\r\n```\r\n$ datasette --get /-/static/app.css --pdb\r\napp_root = /home/ec2-user/.local/pipx/venvs/datasette/lib64/python3.7/site-packages\r\npath = app.css\r\nfull_path=/home/ec2-user/.local/pipx/venvs/datasette/lib/python3.7/site-packages/datasette/static/app.css, root_path=/home/ec2-user/.local/pipx/venvs/datasette/lib64/python3.7/site-packages/datasette/static\r\n ValueError: '/home/ec2-user/.local/pipx/venvs/datasette/lib/python3.7/site-packages/datasette/static/app.css' does not start with '/home/ec2-user/.local/pipx/venvs/datasette/lib64/python3.7/site-packages/datasette/static'\r\n404\r\n```\r\n` ValueError: '/home/ec2-user/.local/pipx/venvs/datasette/lib/python3.7/site-packages/datasette/static/app.css' does not start with '/home/ec2-user/.local/pipx/venvs/datasette/lib64/python3.7/site-packages/datasette/static'`\r\n\r\nOne is `../lib/python3.7/..` and the other is `../lib64/python3.7/..` - there's clearly some kind of symlink in play here which I'm not taking into account.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 756439516, "label": "Datasette on Amazon Linux on ARM returns 404 for static assets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1124#issuecomment-738215487", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1124", "id": 738215487, "node_id": "MDEyOklzc3VlQ29tbWVudDczODIxNTQ4Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T18:50:26Z", "updated_at": "2020-12-03T21:41:25Z", "author_association": "OWNER", "body": "This fix works - calling `.resolve()` on the `root_path` before the comparison to ensure symlinks are resolved:\r\n```python\r\n # Ensure full_path is within root_path to avoid weird \"../\" tricks\r\n try:\r\n print(\"full_path={}, root_path={}\".format(full_path, root_path))\r\n full_path.relative_to(root_path.resolve())\r\n except ValueError as e:\r\n print(\" ValueError:\", e)\r\n await asgi_send_html(send, \"404\", 404)\r\n return\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 756439516, "label": "Datasette on Amazon Linux on ARM returns 404 for static assets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1124#issuecomment-738215686", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1124", "id": 738215686, "node_id": "MDEyOklzc3VlQ29tbWVudDczODIxNTY4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T18:50:48Z", "updated_at": "2020-12-03T21:42:02Z", "author_association": "OWNER", "body": "I'm going to punt on writing a unit test for this (not sure how I'd simulate those symlinks) - I'll manually test it and push out a dot release instead.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 756439516, "label": "Datasette on Amazon Linux on ARM returns 404 for static assets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1124#issuecomment-738220067", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1124", "id": 738220067, "node_id": "MDEyOklzc3VlQ29tbWVudDczODIyMDA2Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T18:58:17Z", "updated_at": "2020-12-03T18:58:17Z", "author_association": "OWNER", "body": "I tested this by running:\r\n\r\n pipx uninstall datasette\r\n pipx install 'https://github.com/simonw/datasette/archive/6b4c55efea3e9d34d92cbe5f0066553ad9b14071.zip'\r\n\r\nTo replace that version of Datasette (in the correct virtual environment) with this patch. It worked!\r\n\r\n```\r\n[ec2-user@ip-172-31-30-7 ~]$ datasette --get /-/static/app.css\r\n/* Reset and Page Setup ==================================================== */\r\n...\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 756439516, "label": "Datasette on Amazon Linux on ARM returns 404 for static assets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1124#issuecomment-738224865", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1124", "id": 738224865, "node_id": "MDEyOklzc3VlQ29tbWVudDczODIyNDg2NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T19:01:52Z", "updated_at": "2020-12-03T19:01:52Z", "author_association": "OWNER", "body": "https://github.com/simonw/datasette/runs/1494631261\r\n```\r\n/home/runner/work/datasette/datasette/tests/test_html.py:81: AssertionError\r\n----------------------------- Captured stderr call -----------------------------\r\nTraceback (most recent call last):\r\n File \"/home/runner/work/datasette/datasette/datasette/app.py\", line 1039, in route_path\r\n response = await view(request, send)\r\n File \"/home/runner/work/datasette/datasette/datasette/utils/asgi.py\", line 297, in inner_static\r\n full_path.relative_to(root_path.resolve())\r\nAttributeError: 'str' object has no attribute 'resolve'\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 756439516, "label": "Datasette on Amazon Linux on ARM returns 404 for static assets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1124#issuecomment-738313399", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1124", "id": 738313399, "node_id": "MDEyOklzc3VlQ29tbWVudDczODMxMzM5OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T21:10:54Z", "updated_at": "2020-12-03T21:10:54Z", "author_association": "OWNER", "body": "Confirmed that installing a fresh copy of Datasette 0.52.3 on that server works correctly as expected.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 756439516, "label": "Datasette on Amazon Linux on ARM returns 404 for static assets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1125#issuecomment-738347171", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1125", "id": 738347171, "node_id": "MDEyOklzc3VlQ29tbWVudDczODM0NzE3MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-03T22:04:52Z", "updated_at": "2020-12-03T22:04:52Z", "author_association": "OWNER", "body": "```\r\npkg_resources.get_distribution(\"pysqlite3\").version\r\nOut[14]: '0.4.4'\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 756622648, "label": "Show pysqlite3 version on /-/versions"}, "performed_via_github_app": null}