-
Notifications
You must be signed in to change notification settings - Fork 101
Description
Good day,
I'm running Grist (grist-omnibus) via Docker (internal deployment only) and found that I should run a localized WidgetRepository.
After cloning grist-widget, initializing & updating the submodules (#170) , installing yarn and finally running the local widget server in watch mode yarn run dev to ensure everything is working, I get the following:
[REMOTE] :/opt/data/grist-widget$ yarn run dev
yarn run v1.22.22
$ echo 'Starting local server and watching for changes.
Start Grist with an environmental variable GRIST_WIDGET_LIST_URL=http://localhost:8585/manifest.json' && npm run watch 1> /dev/null & npm run serve:dev 1> /dev/null && fg
Starting local server and watching for changes.
Start Grist with an environmental variable GRIST_WIDGET_LIST_URL=http://localhost:8585/manifest.json
Publishing external widget @gristlabs/widget-jupyterlite from jupyterlite
Publishing external widget @gristlabs/widget-chart from chart
Publishing external widget @varamil/widget-simplefilter from varamil/simplefilter
As instructed, when I add GRIST_WIDGET_LIST_URL=http://localhost:8585/manifest.json to my docker-compose.yml file and bring up Grist, everything appears to load fine, but when I go to add a custom widget to a page, I get a popup (lower right) in my browser...
Unexpected error
01:03:10 FetchError: request to http://localhost:8585/manifest.json failed, reason: connect ECONNREFUSED 127.0.0.1:8585
Related Logs:
2025-09-15 06:11:24.412 - debug: Auth[GET]: grist.<domain>.com:8443 /widgets customHostSession=, method=GET, host=grist.<domain>.com:8443, path=/widgets, org=<default-org>, email=<user1@domain.tld>, userId=5, altSessionId=ovHxb9LRgppbvLytRMMVUn
2025-09-15 06:11:24.421 - warn: Error during api call to /widgets: FetchError: request to http://localhost:8585/manifest.json failed, reason: connect ECONNREFUSED 127.0.0.1:8585 path=/widgets, userId=5, altSessionId=ovHxb9LRgppbvLytRMMVUn, ,
2025-09-15 06:11:24.475 - debug: Auth[POST]: grist.<domain>.com:8443 /log customHostSession=, method=POST, host=grist.<domain>.com:8443, path=/log, org=<default-org>, email=<user1@domain.tld>, userId=5, altSessionId=ovHxb9LRgppbvLytRMMVUn
2025-09-15 06:11:24.476 - debug: allowHost: req=http://grist.<domain>.com:8443/log, origin=https://grist.<domain>.com:8443, actualUrl=grist.<domain>.com, allowedUrl=grist.<domain>.com
2025-09-15 06:11:24.489 - warn: client error fileName=https://grist.<domain>.com:8443/v/unknown/main.bundle.js, lineNumber=2, columnNumber=821797, message=Request to https://grist.<domain>.com:8443/o/<default-org>/api/widgets failed with status 500: (FetchError: request to http://localhost:8585/manifest.json failed, reason: connect ECONNREFUSED 127.0.0.1:8585), status=500, userError=FetchError: request to http://localhost:8585/manifest.json failed, reason: connect ECONNREFUSED 127.0.0.1:8585, docId=hBZJmgAYnGnfU1VGX9ounm, page=https://grist.<domain>.com:8443/hBZJmgAYnGnf/Untitled-document, language=en-US, platform=Linux x86_64, userAgent=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:142.0) Gecko/20100101 Firefox/142.0, org=<default-org>, email=<user1@domain.tld>, userId=5, altSessionId=ovHxb9LRgppbvLytRMMVUn
This generally makes sense, as I'm accessing Grist from a host on the same network. So I assume that localhost would refer to my browser attempting to connect internally (127.0.0.1), and get a connection refused because I'm not serving anything locally.
Ok, so if I set the environmental variable GRIST_WIDGET_LIST_URL=http://<internal_server_ip>:8585/manifest.json OR GRIST_WIDGET_LIST_URL=http://grist.<domain>.com:8585/manifest.json, I now get a different popup (lower right) in my browser...
WidgetRepository: Remote widget list not found
Related logs:
2025-09-15 06:18:06.366 - debug: Auth[GET]: grist.<domain>.com:8443 /widgets customHostSession=, method=GET, host=grist.<domain>.com:8443, path=/widgets, org=<default-org>, email=<user1@domain.tld>, userId=5, altSessionId=ovHxb9LRgppbvLytRMMVUn
2025-09-15 06:18:06.387 - warn: Error during api call to /widgets: WidgetRepository: Remote widget list not found path=/widgets, userId=5, altSessionId=ovHxb9LRgppbvLytRMMVUn, ,
2025-09-15 06:18:06.560 - debug: Auth[POST]: grist.<domain>.com:8443 /log customHostSession=, method=POST, host=grist.<domain>.com:8443, path=/log, org=<default-org>, email=<user1@domain.tld>, userId=5, altSessionId=ovHxb9LRgppbvLytRMMVUn
2025-09-15 06:18:06.560 - debug: allowHost: req=http://grist.<domain>.com:8443/log, origin=https://grist.<domain>.com:8443, actualUrl=grist.<domain>.com, allowedUrl=grist.<domain>.com
2025-09-15 06:18:06.580 - warn: client error fileName=https://grist.<domain>.com:8443/v/unknown/main.bundle.js, lineNumber=2, columnNumber=821797, message=Request to https://grist.<domain>.com:8443/o/<default-org>/api/widgets failed with status 404: (WidgetRepository: Remote widget list not found), status=404, userError=WidgetRepository: Remote widget list not found, docId=hBZJmgAYnGnfU1VGX9ounm, page=https://grist.<domain>.com:8443/hBZJmgAYnGnf/Untitled-document, language=en-US, platform=Linux x86_64, userAgent=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:142.0) Gecko/20100101 Firefox/142.0, org=<default-org>, email=<user1@domain.tld>, userId=5, altSessionId=ovHxb9LRgppbvLytRMMVUn
This is promising in that the connection refused error has changed, but doesn't appear to be getting the WidgetRepository manifest.
I can definitely see the manifest.json file within the grist-widget directory, let's see if I can try the resource via standard http .. http://<internal_server_ip>:8585/manifest.json. Nope, it appears I get a 404 Not Found with the message Cannot GET /manifest.json. Ok, let's try directly on the server via 'localhost' http://localhost:8585/manifest.json... nope, I get the same response if I attempt it locally on the server.
It's quite possible this is a PEBKAC issue, but thought I would raise it just in case. Happy to be re-educated on this as this is my first ride on with docker/git... so I most likely have missed something. Either way, happy to be supported. Until then, I will continue my online digging to see if I can figure it out.