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