Hello, I’m working with the Specify-7 all-in-one docker-compose setup. I was successful in getting everything to work correctly except for the asset-server. When I try to add an image attachement to a collection object in the Specify-7 portal I get a “Attachment server unavailable” error message. Anyone else has this bug or a solution? Thanks
PS. I’m using Windows 10 Entreprise with Docker Desktop
And added your line before saving the file and rebooting my machine.
127.0.0.1 host.docker.internal
Unfortunately it did not fix my issue. I have the same error message from the attachment server. Everything else seems to work just fine.
I pasted below my docker-compose.yml file with the associated .env file. To facilitate security and deployments on different machines, I put all the docker-compose variables in the .env file. I thus have different .env files on my development, pre-prod and production machines but I’m always using the same docker-compose.yml file.
Can you check if going to localhost/web_asset_store.xml and host.docker.internal/web_asset_store.xml returns a result? If it doesn’t, can you make sure that the /etc/hosts file contains 127.0.0.1 host.docker.internal? Additionally, can you share the result you get by going tohost.docker.internal/web_asset_store.xml?
Can you send the Nginx configuration file you are using?
They do, the logs point towards specify7 not being able to connect to the asset server!
The asset server logs are still empty if you make a request to them? If you make a request to host.docker.internal/web_asset_store.xml does that show up in asset server logs?
Could you restart just the specify7 container, while keeping the other containers running?
Additionally, keep the asset server logs open (docker logs --follow CONTAINER_ID) while restarting specify7, and check if any requests show up there.
Hi,
Doing my best to answerer your questions… here goes…
>>> The asset server logs are still empty if you make a request to them?
I think the only way to make a request to it is through the web portal? If so, yes the asset-server logs stay empty.
>>> If you make a request to host.docker.internal/web_asset_store.xml does that show up in asset server logs?
How can I make a request directly to “host.docker.internal” from outside docker? I tried this… http://localhost:8090/web_asset_store.xml and the logs now have content…
Here it is…
$ docker logs specify7-basic-prototype-installation-asset-server-1
Bottle v0.12.18 server starting up (using PasteServer())...
Listening on http://0.0.0.0:8080/
Hit Ctrl-C to quit.
172.19.0.1 - - [27/Sep/2023:19:08:17 +0000] "GET /web_asset_store.xml HTTP/1.0" 200 455 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.41"
>>> Could you restart just the specify7 container, while keeping the other containers running?
Done. Same error
>>> Additionally, keep the asset server logs open (docker logs --follow CONTAINER_ID) while restarting specify7, and check if any requests show up there.
Done. Nothing more shows up.
root@46940b1c5684:/opt/specify7# curl $ASSET_SERVER_URL
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Not Found</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Not Found</h2>
<hr><p>HTTP Error 404. The requested resource is not found.</p>
</BODY></HTML>
Additionally, for the asset-server service definition, can you change the port from 80 to instead use SPECIFY_EXTERNAL_PORTAL_PORT? It wouldn’t work otherwise.
Awesome! Yes, go ahead and change ASSET_SERVER_URL=http://host.docker.internal/web_asset_store.xml to instead be http://host.docker.internal:${SPECIFY_EXTERNAL_PORTAL_PORT}/web_asset_store.xml.
Additionally, don’t forget to change the asset server port (in asset server definition - from 80 to ${SPECIFY_EXTERNAL_PORTAL_PORT} too, unless you have it explicitly running at port 8080, in which case, use ASSET_SERVER_URL=http://host.docker.internal:8080/web_asset_store.xml for specify service)
In the “asset-server” section of the docker-compose file, I defined the volume configuration for the assets folder, specifying both the source and target directories.
The attachment files are actually located outside the container (at the “source” path) but are accessible within the container at the “target” path (/home/specify/attachments). This setup allows you to view the attachment files without needing to open the container, making it much simpler to back up your attachment folder.
The “source” path is specified in the .env file, so you may want to check that file to see where your attachments are saved on your server or computer. In my example, I was running Docker on Windows and saved the files in a directory I created under my username.