{"html_url": "https://github.com/simonw/datasette/issues/1958#issuecomment-1354025319", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1958", "id": 1354025319, "node_id": "IC_kwDOBm6k_c5QtMln", "user": {"value": 11729897, "label": "davidhaley"}, "created_at": "2022-12-16T00:59:12Z", "updated_at": "2022-12-16T00:59:12Z", "author_association": "NONE", "body": "Awesome. Thank you @simonw.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1497909798, "label": "datasette --root running in Docker doesn't reliably show the magic URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1958#issuecomment-1354023960", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1958", "id": 1354023960, "node_id": "IC_kwDOBm6k_c5QtMQY", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-16T00:58:14Z", "updated_at": "2022-12-16T00:58:19Z", "author_association": "OWNER", "body": "This is in the `0.63.x` branch now, ready to go out in a bug fix release.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1497909798, "label": "datasette --root running in Docker doesn't reliably show the magic URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1958#issuecomment-1354019543", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1958", "id": 1354019543, "node_id": "IC_kwDOBm6k_c5QtLLX", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-16T00:54:11Z", "updated_at": "2022-12-16T00:54:11Z", "author_association": "OWNER", "body": "To test the fix, I did a fresh checkout of `simonw/datasette` and edited `Dockerfile` to look like this:\r\n```dockerfile\r\nFROM python:3.11.0-slim-bullseye as build\r\n\r\nRUN apt-get update && \\\r\n apt-get install -y --no-install-recommends libsqlite3-mod-spatialite && \\\r\n apt clean && \\\r\n rm -rf /var/lib/apt && \\\r\n rm -rf /var/lib/dpkg/info/*\r\n\r\nRUN pip install https://github.com/simonw/datasette/archive/refs/heads/main.zip && \\\r\n find /usr/local/lib -name '__pycache__' | xargs rm -r && \\\r\n rm -rf /root/.cache/pip\r\n\r\nEXPOSE 8001\r\nCMD [\"datasette\"]\r\n```\r\nThen I built it like this:\r\n```\r\ndocker build -f Dockerfile -t datasette-pre-click .\r\n```\r\nAnd ran like this:\r\n```\r\ndocker run -p 8001:8001 -v $(pwd):/mnt datasette-pre-click datasette --root -p 8001 -h 0.0.0.0\r\n```\r\nThis exhibited the same problem.\r\n\r\nThen I pushed a changed to branch and changed the line to:\r\n```\r\nRUN pip install https://github.com/simonw/datasette/archive/refs/heads/click-echo-root.zip && \\\r\n```\r\nRan this:\r\n```\r\ndocker build -f Dockerfile -t datasette-post-click .\r\n```\r\nAnd this:\r\n```\r\ndocker run -p 8001:8001 -v $(pwd):/mnt datasette-post-click datasette --root -p 8001 -h 0.0.0.0\r\n```\r\nIt fixed the problem!\r\n```\r\ndatasette % docker run -p 8001:8001 -v $(pwd):/mnt datasette-post-click datasette --root -p 8001 -h 0.0.0.0\r\nhttp://0.0.0.0:8001/-/auth-token?token=6542dcf5c8f34f8d13f4af9ce728359c602469efb54029098562bd06c87ad26d\r\nINFO: Started server process [1]\r\nINFO: Waiting for application startup.\r\nINFO: Application startup complete.\r\nINFO: Uvicorn running on http://0.0.0.0:8001 (Press CTRL+C to quit)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1497909798, "label": "datasette --root running in Docker doesn't reliably show the magic URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1958#issuecomment-1354008688", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1958", "id": 1354008688, "node_id": "IC_kwDOBm6k_c5QtIhw", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-16T00:45:40Z", "updated_at": "2022-12-16T00:45:40Z", "author_association": "OWNER", "body": "The fix may just be to switch to `click.echo()`. https://click.palletsprojects.com/en/8.1.x/api/#click.echo", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1497909798, "label": "datasette --root running in Docker doesn't reliably show the magic URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1958#issuecomment-1353977605", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1958", "id": 1353977605, "node_id": "IC_kwDOBm6k_c5QtA8F", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-16T00:38:23Z", "updated_at": "2022-12-16T00:38:23Z", "author_association": "OWNER", "body": "Confirmed, I just got the same result:\r\n```\r\n- % docker run datasetteproject/datasette pip install datasette-upload-csvs\r\n~ % docker commit $(docker ps -lq) datasette-with-plugins\r\nsha256:8cde4a6357b9221d6f9e15887a314f2b4d9d1b87b517764d207ccbaec7c0a69f\r\n~ % docker run -p 8001:8001 -v $(pwd):/mnt datasette-with-plugins datasette --root -p 8001 -h 0.0.0.0\r\nINFO: Started server process [1]\r\nINFO: Waiting for application startup.\r\nINFO: Application startup complete.\r\nINFO: Uvicorn running on http://0.0.0.0:8001 (Press CTRL+C to quit)\r\n\r\n\r\n\r\n^CINFO: Shutting down\r\nINFO: Waiting for application shutdown.\r\nINFO: Application shutdown complete.\r\nINFO: Finished server process [1]\r\nhttp://0.0.0.0:8001/-/auth-token?token=4bd70fdbca215ea55c874eaf889adf8c09f2a00231f7e5e6d0470f3176407a98\r\n```\r\nNote how the auth-token URL is only displayed after you hit `Ctrl+C`!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1497909798, "label": "datasette --root running in Docker doesn't reliably show the magic URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1958#issuecomment-1352644281", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1958", "id": 1352644281, "node_id": "IC_kwDOBm6k_c5Qn7a5", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-15T07:08:14Z", "updated_at": "2022-12-15T07:08:14Z", "author_association": "OWNER", "body": "Thanks for the details write-up! This looks like a bug in Datasette itself when run with Docker. Moving this issue there.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1497909798, "label": "datasette --root running in Docker doesn't reliably show the magic URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1958#issuecomment-1352644276", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1958", "id": 1352644276, "node_id": "IC_kwDOBm6k_c5Qn7a0", "user": {"value": 11729897, "label": "davidhaley"}, "created_at": "2022-12-14T14:53:53Z", "updated_at": "2022-12-14T14:53:53Z", "author_association": "NONE", "body": "I don't have much experience with Python; however, I wonder if this print statement needs `flush=True`?\r\n\r\nhttps://github.com/simonw/datasette/blob/fdf7c27b5438f02153c3a7f8ad1b320e4b29e4f4/datasette/cli.py#L621", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1497909798, "label": "datasette --root running in Docker doesn't reliably show the magic URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1958#issuecomment-1352644274", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1958", "id": 1352644274, "node_id": "IC_kwDOBm6k_c5Qn7ay", "user": {"value": 11729897, "label": "davidhaley"}, "created_at": "2022-12-14T14:19:24Z", "updated_at": "2022-12-14T14:19:24Z", "author_association": "NONE", "body": "Hmm, it appears after I kill the process with `Ctrl+c`:\r\n\r\n![image](https://user-images.githubusercontent.com/11729897/207619736-a49b2e97-c5d0-4e54-ad3c-3c3c279927c7.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": 1497909798, "label": "datasette --root running in Docker doesn't reliably show the magic URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1958#issuecomment-1352644270", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1958", "id": 1352644270, "node_id": "IC_kwDOBm6k_c5Qn7au", "user": {"value": 11729897, "label": "davidhaley"}, "created_at": "2022-12-14T00:05:16Z", "updated_at": "2022-12-14T00:05:16Z", "author_association": "NONE", "body": "FYI @simonw, I don't see that message.\r\n\r\n![image](https://user-images.githubusercontent.com/11729897/207471893-1ec5d4d0-81db-4eaa-ba40-adedcc7c9a32.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": 1497909798, "label": "datasette --root running in Docker doesn't reliably show the magic URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1958#issuecomment-1352644267", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1958", "id": 1352644267, "node_id": "IC_kwDOBm6k_c5Qn7ar", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-13T18:33:32Z", "updated_at": "2022-12-13T18:33:32Z", "author_association": "OWNER", "body": "When you run `--root` you need to follow the special link that gets output to the console:\r\n\r\n```\r\n% datasette --root\r\nhttp://127.0.0.1:8001/-/auth-token?token=036d8055cc8000e9667f21c1dd08722a9358c066463873ad9566d23d88765c52\r\nINFO: Started server process [53934]\r\nINFO: Waiting for application startup.\r\nINFO: Application startup complete.\r\n```\r\nThat `/-/auth-token?...` link is the one that sets the cookie and lets you in.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1497909798, "label": "datasette --root running in Docker doesn't reliably show the magic URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1958#issuecomment-1352644262", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1958", "id": 1352644262, "node_id": "IC_kwDOBm6k_c5Qn7am", "user": {"value": 11729897, "label": "davidhaley"}, "created_at": "2022-12-13T16:49:31Z", "updated_at": "2022-12-13T16:49:52Z", "author_association": "NONE", "body": "I may have found the reason. I don't think the `--root` option is taking effect.\r\n\r\nVisited: http://127.0.0.1:8001/-/permissions\r\n\r\n![image](https://user-images.githubusercontent.com/11729897/207394127-59f8320f-3410-4ff8-869d-b19ab955d67c.png)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1497909798, "label": "datasette --root running in Docker doesn't reliably show the magic URL"}, "performed_via_github_app": null}