{"html_url": "https://github.com/simonw/datasette/issues/717#issuecomment-610076073", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/717", "id": 610076073, "node_id": "MDEyOklzc3VlQ29tbWVudDYxMDA3NjA3Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-06T22:47:21Z", "updated_at": "2020-04-06T22:47:21Z", "author_association": "OWNER", "body": "I'm confident it's possible to create a plugin that deploys to Now v2 now. I'll do the rest of the work in a separate repo: https://github.com/simonw/datasette-publish-now", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 594189527, "label": "See if I can get Datasette working on Zeit Now v2"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/717#issuecomment-610067097", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/717", "id": 610067097, "node_id": "MDEyOklzc3VlQ29tbWVudDYxMDA2NzA5Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-06T22:20:11Z", "updated_at": "2020-04-06T22:20:11Z", "author_association": "OWNER", "body": "Yes I think that's it - I created a table in `about.db`, then dropped that table and ran `vacuum` and the result was an empty database file that wasn't zero bytes. I deployed it and it worked: https://datasette-koo7abu7j.now.sh/ ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 594189527, "label": "See if I can get Datasette working on Zeit Now v2"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/717#issuecomment-610066089", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/717", "id": 610066089, "node_id": "MDEyOklzc3VlQ29tbWVudDYxMDA2NjA4OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-06T22:17:32Z", "updated_at": "2020-04-06T22:17:53Z", "author_association": "OWNER", "body": "I think that error might be because Niche Museums uses two database files that are 0 bytes (about.db and map.db) - I just tried purely publishing the empty about.db file and got the same error: https://datasette-ks55wp251.now.sh/ - https://datasette-ks55wp251.now.sh/-/databases", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 594189527, "label": "See if I can get Datasette working on Zeit Now v2"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/717#issuecomment-609905777", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/717", "id": 609905777, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTkwNTc3Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-06T16:41:04Z", "updated_at": "2020-04-06T16:43:05Z", "author_association": "OWNER", "body": "Full traceback from Zeit Now logs:\r\n```\r\nERROR: conn=, sql = \"select name from sqlite_master where type='table'\", params = None: disk I/O error\r\nTraceback (most recent call last):\r\nFile \"/var/task/datasette/utils/asgi.py\", line 121, in route_path\r\nreturn await view(new_scope, receive, send)\r\nFile \"/var/task/datasette/utils/asgi.py\", line 193, in view\r\nrequest, **scope[\"url_route\"][\"kwargs\"]\r\nFile \"/var/task/datasette/views/base.py\", line 61, in head\r\nresponse = await self.get(*args, **kwargs)\r\nFile \"/var/task/datasette/views/index.py\", line 27, in get\r\ntable_names = await db.table_names()\r\nFile \"/var/task/datasette/database.py\", line 221, in table_names\r\n\"select name from sqlite_master where type='table'\"\r\nFile \"/var/task/datasette/database.py\", line 167, in execute\r\nsql_operation_in_thread\r\nFile \"/var/task/datasette/database.py\", line 114, in execute_against_connection_in_thread\r\nself.ds.executor, in_thread\r\nFile \"/var/lang/lib/python3.6/concurrent/futures/thread.py\", line 56, in run\r\nresult = self.fn(*self.args, **self.kwargs)\r\nFile \"/var/task/datasette/database.py\", line 111, in in_thread\r\nreturn fn(conn)\r\nFile \"/var/task/datasette/database.py\", line 137, in sql_operation_in_thread\r\ncursor.execute(sql, params or {})sqlite3.OperationalError: disk I/O error\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 594189527, "label": "See if I can get Datasette working on Zeit Now v2"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/717#issuecomment-609905147", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/717", "id": 609905147, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTkwNTE0Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-06T16:39:50Z", "updated_at": "2020-04-06T16:39:50Z", "author_association": "OWNER", "body": "I tried deploying the whole of www.niche-museums.com with mixed results.\r\n\r\nhttps://datasette-jm25oxd7s.now.sh/browse/museums works\r\nhttps://datasette-jm25oxd7s.now.sh/ shows \"disk I/O error\"", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 594189527, "label": "See if I can get Datasette working on Zeit Now v2"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/717#issuecomment-609889528", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/717", "id": 609889528, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTg4OTUyOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-06T16:11:07Z", "updated_at": "2020-04-06T16:11:07Z", "author_association": "OWNER", "body": "https://now-2-datasette-e4l4whc9f.now.sh/-/versions\r\n```json\r\n{\r\n \"python\": {\r\n \"version\": \"3.6.10\",\r\n \"full\": \"3.6.10 (default, Mar 10 2020, 22:54:43) \\n[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]\"\r\n },\r\n \"datasette\": {\r\n \"version\": \"0.39\"\r\n },\r\n \"asgi\": \"3.0\",\r\n \"uvicorn\": \"0.11.3\",\r\n \"sqlite\": {\r\n \"version\": \"3.7.17\",\r\n \"fts_versions\": [\r\n \"FTS4\",\r\n \"FTS3\"\r\n ],\r\n \"extensions\": {},\r\n \"compile_options\": [\r\n \"DISABLE_DIRSYNC\",\r\n \"ENABLE_COLUMN_METADATA\",\r\n \"ENABLE_FTS3\",\r\n \"ENABLE_RTREE\",\r\n \"ENABLE_UNLOCK_NOTIFY\",\r\n \"SECURE_DELETE\",\r\n \"TEMP_STORE=1\",\r\n \"THREADSAFE=1\"\r\n ]\r\n }\r\n}\r\n```\r\nSQLite 3.7.17 is from May 2013: http://www.sqlite.org/releaselog/3_7_17.html - and there's no FTS5 (but we do get FTS4).\r\n\r\nSo the Now v2 version will be a bit limited (no support for table names containing `/` and an ancient SQLite version without FTS5) - but it's definitely enough for a `datasette-publish-now` plugin.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 594189527, "label": "See if I can get Datasette working on Zeit Now v2"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/717#issuecomment-609887635", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/717", "id": 609887635, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTg4NzYzNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-06T16:07:51Z", "updated_at": "2020-04-06T16:08:47Z", "author_association": "OWNER", "body": "Built myself a quick ASGI scope debugging tool: https://now-2-asgi-scope.now.sh/\r\n\r\nSame `now.json` as above, but `index.py` is this:\r\n```python\r\nfrom pprint import pformat\r\n\r\n\r\nasync def app(scope, receive, send):\r\n await send({\r\n 'type': 'http.response.start',\r\n 'status': 200,\r\n 'headers': [\r\n [b'content-type', b'text/plain'],\r\n ],\r\n })\r\n await send({\r\n 'type': 'http.response.body',\r\n 'body': pformat(scope).encode('utf8'),\r\n })\r\n```\r\nhttps://now-2-asgi-scope.now.sh/fixtures/table%2Fwith%2Fslashes.csv shows what's going on - those `%2F` have been decoded to `/` before they get to the ASGI app - probably by the Now routing layer:\r\n```\r\n...\r\n 'http_version': '1.1',\r\n 'method': 'GET',\r\n 'path': '/fixtures/table/with/slashes.csv',\r\n 'query_string': b'',\r\n 'raw_path': b'/fixtures/table/with/slashes.csv',\r\n...\r\n```\r\nThat `raw_path` there needs to be `b'/fixtures/table%2Fwith%2Fslashes.csv'` in order for Datasette to fully work here.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 594189527, "label": "See if I can get Datasette working on Zeit Now v2"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/717#issuecomment-609883545", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/717", "id": 609883545, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTg4MzU0NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-06T16:00:41Z", "updated_at": "2020-04-06T16:03:21Z", "author_association": "OWNER", "body": "https://now-2-datasette-e4l4whc9f.now.sh/ - first proof of concept!\r\n\r\nIt's just four files right now, all in the same directory and deployed by running `now`.\r\n\r\n`now.json`\r\n```json\r\n{\r\n \"version\": 2,\r\n \"builds\": [\r\n {\r\n \"src\": \"index.py\",\r\n \"use\": \"@now/python\"\r\n }\r\n ],\r\n \"routes\": [\r\n {\r\n \"src\": \"(.*)\",\r\n \"dest\": \"index.py\"\r\n }\r\n ]\r\n}\r\n```\r\n`requirements.txt`:\r\n```\r\ndatasette\r\ndatasette-debug-asgi\r\n```\r\n`index.py`:\r\n```python\r\nfrom datasette.app import Datasette\r\n\r\napp = Datasette([\"fixtures.db\"]).app()\r\n```\r\nPlus a copy of the standard `fixtures.db` file.\r\n\r\nIt almost entirely works! Just one bug so far:\r\n\r\nhttps://now-2-datasette-e4l4whc9f.now.sh/fixtures/table%2Fwith%2Fslashes.csv returns a 404\r\nhttps://latest.datasette.io/fixtures/table%2Fwith%2Fslashes.csv does not.\r\n\r\nPlugins work too - here's the output from `datasette-debug-asgi`: https://now-2-datasette-e4l4whc9f.now.sh/-/asgi-scope", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 594189527, "label": "See if I can get Datasette working on Zeit Now v2"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/717#issuecomment-609306846", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/717", "id": 609306846, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTMwNjg0Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-05T04:18:48Z", "updated_at": "2020-04-05T04:18:48Z", "author_association": "OWNER", "body": "I need to route all paths to the same function. This should help: https://twitter.com/aboodman/status/1246605658067066882\r\n\r\n![image](https://user-images.githubusercontent.com/9599/78466750-d4d55700-76b9-11ea-8fac-cfa674b9785b.png)\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 594189527, "label": "See if I can get Datasette working on Zeit Now v2"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/717#issuecomment-609111516", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/717", "id": 609111516, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTExMTUxNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-05T00:57:29Z", "updated_at": "2020-04-05T00:57:29Z", "author_association": "OWNER", "body": "If I can get this working I think I'll release it as a plugin, similar to [datasette-publish-fly](https://github.com/simonw/datasette-publish-fly).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 594189527, "label": "See if I can get Datasette working on Zeit Now v2"}, "performed_via_github_app": null}