Uploaded Logo Not Found

I have installed Invoice Ninja via Docker but am having issues with uploading a logo. I upload a logo and see an error in the browser console that the resource http://in.localhost.test:8003/storage/0rhlwgvpr5nwfyx7ctrjuaph1o41ib5uaeafscxizotedxbigevgikropvak1jdn/NrSFO6zhKIPGhAIC3P4OJ3nYM08RYiqlllWM6wKR.png cannot be found.

It appears that the image does indeed exist on the server, so something with a path seems incorrect. I found two similar threads but either were not applicable to a Docker install or at least I could not find where to make the recommended changed.

Thanks.

1 Like

Hi,

It may help to set LOCAL_DOWNLOAD=true in the .env settings

https://invoiceninja.github.io/docs/env-variables/

Thanks for the reply. I added that to the env file to no effect. However, I’m not sure that the file is being reloaded properly. I installed with docker compose and then stop and restart the container. Will that reload the env file?

Yes, I would think so

@david any suggestions?

Are you using the standard dockerfile, or a custom one?

I used docker-compose following these instructions: https://github.com/invoiceninja/dockerfiles

in the hosts file

can you add your URL with IP 127.0.0.1 (if you are on a LAN)

Thank you. I played around with the hosts files and we are getting close. The logo appears upon upload and in the top left of the Invoice Ninja GUI. However, on any PDF documents it does not and shows the broken image icon and alternate text. I’d really like to get a logo in the invoices if possible. I have the PDF_GENERATOR in the env file set to the snappdf generator.

How do you reload the env file? I am trying to migrate to Phantomjs, however, starting and stopping the docker container does not seem to actually reload it.

Hello David. I have a question about it. The host file, would it correspond to the .htaccess? I currently use a self-hosted version / v5; in a subdomain and experience the same with the logo. I have read threads, trying everything, but nothing. It is shared hosting from Hostinger. Google translate :smile:

@Diagram13

Try using LOCAL_DOWNLOAD=true in your .env file

If you are using Docker, the env file is in the root of the dockerfiles repo.

I already tried but it’s still the same. The Google console throws this error:
POST: https://fac.dominio.com/index.php/api/v1/refresh?current_company=true&updated_at=1634091839&first_load=true > js_primitives.dart > No se puede cargar el contenido de org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_primitives.dart (Error de HTTP: código de estado 404,net::ERR_UNKNOWN_URL_SCHEME)

The reload issues were just a browser cache problem. I had previously tried LOCAL_DOWNLOAD=true and did so again to no effect.

Is there any sort of PDF generation log that can be viewed?

When I edit the invoice design and preview in HTML mode the logo is displayed properly. Is there any way to actually generate an invoice in HTML mode and then I can convert to a PDF?

After editing .env you always need to

php artisan optimize

for me, I added this line:

127.0.0.1 myurl.com

to the hosts inside windows/system32/drivers/ file on windows

btw I installed ninja using wsl2 and docker locally

That is one unexpected way to install ninja :slight_smile: Nice job!

1 Like

v5.10.40 / Docker

When I inspect the code with Chrome I found the image reference like this:

<img class="w-8" src="http://in.localhost:8003/storage/5qPaYYFXfihJ4JBgaFrpAI1Qo2pfKKq7/xzjUgZ9c4N0OhpEHoku80VnbXuSw8ljpZ08eaTkj.png" alt="Company logo">

But this link does not work: http://in.localhost:8003/storage/5qPaYYFXfihJ4JBgaFrpAI1Qo2pfKKq7/xzjUgZ9c4N0OhpEHoku80VnbXuSw8ljpZ08eaTkj.png

Direct IP works:
http://192.168.178.124/storage/5qPaYYFXfihJ4JBgaFrpAI1Qo2pfKKq7/xzjUgZ9c4N0OhpEHoku80VnbXuSw8ljpZ08eaTkj.png

What should I alter so it references to direct IP instead of “in.localhost:8003”?

App URL

# IN application vars
APP_URL=http://in.localhost:8003

to

# IN application vars
APP_URL=http://192.168.178.124:8003

Or something in my hosts file:

192.168.0.124 in5.test