Logo is not showing in Settings>Company Details>Logo

Version v5.11.7

Environment Docker

I just created a new Docker container and added a logo in Settings>Company Details>Logo. Immediately the light and dark logo previews in settings change to a broken link picture and so does the logo in the top left of the menu by the logged in user. What’s strange is that the logo works fine on Quotes and Invoices it seems to only me an issue in the Web UI.

The logo file is added to:

../app_storage/app/public/VATD3vIqUGxBRebrPyAdXszJuORmf7JM/l5CyGGdbwhGimtj3Vb9OAR7Y5JJk0Z0DHKonjdXH.png

Inspecting the page for the broken link picture shows this:

<img class="w-8" src="https://<myFqdn.com>/public/storage/VATD3vIqUGxBRebrPyAdXszJuORmf7JM/l5CyGGdbwhGimtj3Vb9OAR7Y5JJk0Z0DHKonjdXH.png" alt="Company logo">

I’ve read every Logo issue post I found that sounded similar and I’ve tried everything… TRUSTED_PROXIES='*' was already in my .env file. I tried adding
LOCAL_DOWNLOAD=true to my .env file. I’ve set the APP_URL=https://myFqdn.com and I’ve also tried adding /public to the end of the APP_URL. I’ve also tried setting APP_URL to the local IP address nothing helped.

For background these are the steps I used to create my container:

  1. git clone GitHub - invoiceninja/dockerfiles: Docker files for Invoice Ninja -b debian /data/invoice-ninja/dockerfiles
  2. sudo mkdir -p /data/invoice-ninja/{app_cache,app_public,app_storage,mysql_data,redis_data}
  3. sudo chown -R 1000:1000 /data/invoice-ninja/{app_cache,app_public,app_storage,mysql_data,redis_data}
  4. Copy contents of docker-compose.yml and .env from /data/invoice-ninja/dockerfiles/debian/ to Dockge then modify
  5. Run container from Dockge

For reference here is my compose.yml file:

x-logging: &a1
  options:
    max-size: 10m
    max-file: "3"
  driver: json-file
services:
  nginx:
    container_name: InvoiceNinja-Server
    image: nginx:alpine
    depends_on:
      - app
    volumes:
      - ${DOCKERFILES_DEBIAN}/nginx:/etc/nginx/conf.d:ro
      - app_public:/var/www/html/public:ro
      - app_storage:/var/www/html/storage:ro
    logging: *a1
    labels:
      - wud.watch.digest=true
    restart: unless-stopped
    networks:
      bridge: null
      MacVLAN:
        ipv4_address: ${IP}

  app:
    build:
      context: ${DOCKERFILES_DEBIAN}
    container_name: InvoiceNinja-App
    image: invoiceninja/invoiceninja-debian:${TAG:-latest}
    depends_on:
      mysql:
        condition: service_healthy
      redis:
        condition: service_healthy
    volumes:
      - ./.env:/var/www/html/.env
      - ${DOCKERFILES_DEBIAN}/php/php.ini:/usr/local/etc/php/conf.d/zzz-php.ini:ro
      - ${DOCKERFILES_DEBIAN}/php/php-fpm.conf:/usr/local/etc/php-fpm.d/zzz-php-fpm.conf:ro
      - ${DOCKERFILES_DEBIAN}/supervisor/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf:ro
      - app_cache:/var/www/html/bootstrap/cache
      - app_public:/var/www/html/public
      - app_storage:/var/www/html/storage
    env_file:
      - ./.env
    logging: *a1
    labels:
      - wud.watch.digest=true
    restart: unless-stopped
    networks:
      - bridge
  redis:
    container_name: InvoiceNinja-Cache
    image: redis:alpine
    volumes:
      - redis_data:/data
    logging: *a1
    labels:
      - wud.watch.digest=true
    healthcheck:
      test:
        - CMD
        - redis-cli
        - ping
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
    networks:
      - bridge
  mysql:
    container_name: InvoiceNinja-Db
    image: mysql:8
    volumes:
      - mysql_data:/var/lib/mysql
    env_file:
      - ./.env
    environment:
      MYSQL_DATABASE: ${DB_DATABASE}
      MYSQL_USER: ${DB_USERNAME}
      MYSQL_PASSWORD: ${DB_PASSWORD}
      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
    logging: *a1
    labels:
      - wud.watch.digest=true
    healthcheck:
      test:
        - CMD
        - mysqladmin
        - ping
        - -h
        - localhost
        - -u${MYSQL_USER}
        - -p${MYSQL_PASSWORD}
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
    networks:
      - bridge
networks:
  bridge:
    name: bridge_invoice-ninja
    driver: bridge
  MacVLAN:
    external: true
volumes:
  app_cache:
    driver: local
    driver_opts:
      type: none
      device: /data/invoice-ninja/app_cache
      o: bind
  app_public:
    driver: local
    driver_opts:
      type: none
      device: /data/invoice-ninja/app_public
      o: bind
  app_storage:
    driver: local
    driver_opts:
      type: none
      device: /data/invoice-ninja/app_storage
      o: bind
  mysql_data:
    driver: local
    driver_opts:
      type: none
      device: /data/invoice-ninja/mysql_data
      o: bind
  redis_data:
    driver: local
    driver_opts:
      type: none
      device: /data/invoice-ninja/redis_data
      o: bind

And here’s my .env file:

IP=<redacted>
DOCKERFILES_DEBIAN=/data/invoice-ninja/dockerfiles/debian

# IN application vars
APP_URL=https://<myfqdn.com>
APP_KEY=<redacted>
APP_ENV=production
APP_DEBUG=false
REQUIRE_HTTPS=false
PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=snappdf
TRUSTED_PROXIES='*'
#LOCAL_DOWNLOAD=true # added to troubleshoot logo not showing


CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

FILESYSTEM_DISK=debian_docker

# DB connection
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=ninja
DB_USERNAME=ninja
DB_PASSWORD=ninja
DB_ROOT_PASSWORD=ninjaAdm1nPassword
DB_CONNECTION=mysql

# Create initial user
# Default to these values if empty
[email protected]
IN_PASSWORD=changeme!
# IN_USER_EMAIL=
# IN_PASSWORD=

# Mail options
MAIL_MAILER=log
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS='[email protected]'
MAIL_FROM_NAME='Self Hosted User'

# MySQL
MYSQL_DATABASE=ninja
MYSQL_USER=ninja
MYSQL_PASSWORD=ninja
MYSQL_ROOT_PASSWORD=ninjaAdm1nPassword

# GoCardless/Nordigen API key for banking integration
NORDIGEN_SECRET_ID=
NORDIGEN_SECRET_KEY=

IS_DOCKER=true
SCOUT_DRIVER=null
SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable

Hi,

If you’ve made changes to the APP_URL you’ll need to re-upload the logo for it to take effect, maybe it helps explain the problem.

I set the APP_URL before the container was created. When I changed it, I deleted the container and all mapped folders so it each time it was completely clean…

I found this thread mentioning the same issue and based on that I was able to confirm that if you chmod the folder with the long random name here app_storage/app/public/<LongRandomName>/ to 755 then the logo shows properly.

In that thread @david said:

…I believe there is a PR that will make the logo appear within the admin panel, which should resolve that particular issue.

It seems this is a known issue then. Can you or David help point me to the PR so I can follow it?

Are you sure you can resolve your APP Domain from within the container?

This would be the only reason why the logo does not display, you can confirm this by viewing an invoice in the client portal, if the logo appears there, it is an issue with dns resolution in the container.

Are you sure you can resolve your APP Domain from within the container?

I think you may be confused or maybe I am. I’m not aware of an issue with my domain everything is works fine it’s just that once I upload a company logo that logo shows as a broken image link on the Settings>Company Details>Logo page and in the upper left corner next to the user name.

I have confirmed that this can be fixed by changing permissions of the subfolder within the app_storage volume mapping on the host machine and easily re-broken by changing the permissions back to 700.

I never mentioned the client portal but the image on the client portal login screen is also broken until the chmod to 755 is done. I’m talking about a clean install so there are no quotes, invoices or even clients at this point.

Further investigation… the app_storage/app/public/<LongRandomName>/ folder is not created when initially starting the docker containers. It is first created when uploading a company logo. The folder’s Owner is www-data with rwx------ permissions.

Here’s screenshots:

Hi all,
I’m expecting the same error.
Looking at the html source code I’ve noticed that the logo points to the localhost instead of the FQDN

In my .env file the is set to APP_URL=https://my.fqdn.com

Maybe I have to set somewhere else?

If you’ve changed the APP_URL it may help to re-upload the logo.

1 Like

Now it works :slight_smile: thank you :+1:

1 Like

Hey @SKAL, what did you land up running to fix your issue? I am setting up my container at the moment and getting the same thing on this side. I have gotten everything working on the new image, these are my mappings, when things are running I get a similar issue with the portal company image not being uploaded/error on upload.

Example of App Volume Mappings:

- 'docker/invoiceninja/docker/app/.env:/var/www/html/.env'
- 'docker/invoiceninja/docker/app/storage/framework/cache/:/var/www/html/bootstrap/cache/'
- 'docker/invoiceninja/docker/app/storage/framework/sessions/:/var/www/html/bootstrap/sessions/'
- 'docker/invoiceninja/docker/app/storage/framework/views/:/var/www/html/bootstrap/views/'
- 'docker/invoiceninja/docker/app/public/:/var/www/html/public/'
- 'docker/invoiceninja/docker/app/storage/:/var/www/html/storage/'

Furthermore, I then run a few quick commands to set up the container correctly (without having to use the default invoice ninja compose file, including allowing my containers to boot up with different names. Small, petty things and mostly for my own preference:

cp laravel.conf laravel.conf.bak; sed -i 's/fastcgi_pass app:9000/fastcgi_pass invoiceninja-app:9000/g' laravel.conf; 
sudo chown 1500:1500 -R /home/kratos/docker/invoiceninja/docker/app/; 
sudo chmod 755 -R /home/kratos/docker/invoiceninja/docker/app/public; 
sudo chmod 755 -R /home/kratos/docker/invoiceninja/docker/app/storage;

Lastly, this works perfectly now, I can book into the container, create data and invoices, but I have the same company image issue as above, when I go a load a new PNG, I get the page error: “Something went wrong” and in the logs:

[2025-01-20 16:15:24] local.ERROR: Unable to create a directory at /var/www/html/public/storage. {“userId”:1,“exception”:"[object] (League\Flysystem\UnableToCreateDirectory(code: 0): Unable to create a directory at /var/www/html/public/storage. at /var/www/html/vendor/league/flysystem/src/UnableToCreateDirectory.php:18)> Blockquote

Iv been bashing my head as this is the last bit for the last two days. The logo is working correctly in the invoices and everything else is working perfectly fine. I would really like to follow this custom setup of mine that combines my compose with all my other containers and avoids the volume route so I am stubbon for following and doing things this way but I really want to get it working.

I was just struggling to get things working and I was not sure, from your message what you ran to fix it? I tend to be very handi-capped when It comes to running “things” within containers so hoping you could assist please! I don’t seem to be getting any app/public/<LongRandomName>/ files on my side, logs would indicate that it cannot even create the dir so makes sense.


Okay problem halfway there, I clearly needed a shower and food after all this time! I now have a storage folder, shell’d into the container and saw that my storage folder was in fact a file (no idea If I am mapping my docker volume incorrectly that is causing this but my storage “file” is located in:

/var/www/html/public/storage

No idea why this happened (again), so I shell’d into the app container and ran:

rm -rf /var/www/html/public/storage; 
cd /var/www/html/public/; 
mkdir -p storage/; 
chmod 775 storage/; 
chown -R www-data:www-data storage/;

Then, on the portal, I went to re-upload my image, I now atleast have a /var/www/html/public/storage/ <LongRandomName>/ <LongRandomFileName.png> in the containers files, doing an ls -l after doing the portal upload shows:

6035505 drwxr-xr-x 2 www-data www-data 4096 Jan 20 20:12 LongRandomName

and

6035506 -rw-rw-r-- 1 www-data www-data 100950 Jan 20 20:12 LongRandomFileName.png

I tried to 755 them too and no luck, portal still shows a blank image but invoices show the company logo correctly atleast!

Okay, I managed to solve my issues. Oddly enough, and this is maybe my walkaway moment if someone can help me, I had completed the above steps but my APP_URL was still my local IP, anyway for giggles I tried to update it to my FQDN to see if anything was different. It reset my storage folder changed that I made above but went and made a new storage FILE as this is what I had a problem with yesterday when I was exploring my options. This seems to be the issue, It’s not creating a folder but rather a file, so when the folder wants to be created to store the images in, something already exists.

In short, I changed my FQDN and I ran the following commands, I didn’t have to shell into the container, I could do this from my Docker instance, I am fully up and running now.

rm -rf invoiceninja/docker/app/public/storage;
mkdir -p /invoiceninja/docker/app/public/storage/; 
chmod 755 /invoiceninja/docker/app/public/storage/; 
chown -R www-data:www-data invoiceninja/docker/app/public/storage/; 

I feel like I am on a journey of self discovery but want to keep posting here as it helps with anyone else struggling with the same issues, other posts can be ignored, I did a full cleanup of my script so thats not relevant anymore.

I can now however confirm @LorneCash issue posted, I have done a fresh install, uploaded an image and image is not visible until I run chmod 755 on my app storage folder.

1 Like

I suggest using the network tab in the browser console to find the logo URL and try loading it directly.

Important to remember you need to re-upload the logo after changing the APP_URL.

This isn’t the issue, the issue is the permissions on the storage folder where the logo is being stored. This is on a fresh installation, with the APP URL being set from the start of the container’s coming up. The path to the image is as follows when inspecting element:

https://mydomainname.com/ storage/ LongRandomName/ LongRandomFileName.png

1 Like

@hillel Are you still not able to confirm this behavior is a bug? It seems both @Soprono and myself are able to reproduce it quite easily when starting up a completely new instance.

If you think it’s a bug you may want to create a discussion on GitHub