Images and attachments not found by webserver and pdf generator (docker env.)

I can upload and add images in letter head and report templates. But when preview them the image is not shown. Same happens when a PDF is generated. When I open the file in the file manager, images are also not showing a preview and I get nothing when downloading.


There seems to be a general issue for the application to lookup the files on the file system.
I played around with the “host_name” setting in site_config, by using the IP address of the host or the IP of the container instead of the domain name but it did not help.
All logs I have seen so far contained no indication of an error.
Permission on file system shows frappe:frappe (from container perspective)

Any idea what could be the issue in my docker setup?
Which log file could I check?
Thanks for your help.

any luck?
i am facing same issue

Oh, happy to hear that I am not alone.
No, no progress, I put this installation on hold but now thinking of finding a professional consultant who could help me.

I know Revant has done some extensive work using docker. Hopefully he can suggest a solution. @revant_one could you pls assist if/when you get the opportunity ?

Thanks

@wale

I tried PWD, it’s working on latest builds

2 Likes

problem comes when change in web port from default(80) to something else
is there any way to edit nginx port as well?

Wow, super you found the issue. I will check my setup as well.
Solution highly appreciated, as this is the only thing that stops me from using ERPNext (I have to run it in Docker).

Does adding hostname and port keys to site_config.json help? Also add the port, if it’s not 80

Hi @revant_one, thanks a lot for helping us.
I my case I had already the port in there, but see the same problem.
What do you mean with “port keys” exactly?

my compose file service
webserver:
image: frappe/erpnext-nginx:${ERPNEXT_VERSION}
ports:
- “3380:80”

my site config (partially, with out db settings)
“dormant”: true,
“encryption_key”: “ckTCr…Duw=”,
“host_name”: “http://erpnext.mydomain:3380

I got another hint, that when the server has multiple NICs with different IPs, docker can get confused. I have will now combine them to a bond and see if it helps.
Are you aware of such docker issues?

...
"host_name": "https://erpnext.mydomain",
"port": 3380,
...

Hi @revant_one
finally I was able to start my instance and change the site config:
“host_name”: “http://erpnext.mydomain”,
“port”: “3380”
But still the same issue. I can delete, upload files, but when it comes to download they are not found anymore.

I don’t know what can be done.

@Muhammad_Anees does the port setting resolve your issue?
@revant_one any suggestions what I can check or does a debug log help? Where can I find the log? Assume we need the web server one.

Just found it: I had to configure a reverse proxy with port 80
I did only a DNS entry and was able to access the site via http://erpnext.mydomain:3380
with the reverse proxy I am using http://erpnext.mydomain without a port
Oh my goodness :grinning::relieved:

i am using some other application on 80(virtualmin) port. is it possible any otherway?

check if this helps, ERPNext behind NGINX Reverse Proxy - #2 by revant_one

ok thank will check this