Docker image 5.1.42 snappdf not working

I have installed the latest invoiceninja:5.1.42.

There are no errors in the larvel.log file
I am recieving a 504 Gateway time-out, when trying to view a pdf on a quote.

in-vhost.conf
server {
    listen 80 default_server;
    server_name _;

    root /var/www/app/public/;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass app_invoiceninja:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }
}
docker-compose.yml
version: '3.7'
x-image-invoiceninja: 
  &ninja
    invoiceninja/invoiceninja:5.1.42
x-image-mysql:
  &mysql
    mysql:5.7.33
x-image-nginx:
  &nginx
    nginx:1.19.9

services:
  server_invoiceninja:
    image: *nginx
    volumes:
      - /share/CACHEDEV4_DATA/KVM/Docker/Volumes/ninja/app/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
      - /share/CACHEDEV4_DATA/KVM/Docker/Volumes/ninja/app/public:/var/www/app/public:ro
    depends_on:
      - app_invoiceninja
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=proxy"
      - "traefik.http.services.app-ninjainvoice.loadbalancer.server.port=80"

      - "traefik.http.routers.ninjainvoice.entrypoints=web"
      - "traefik.http.routers.ninjainvoice.rule=Host(`in5.REDACTED`)"
      #- "traefik.http.routers.ninjainvoice.middlewares=https-redirect"
      #- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"

      - "traefik.http.routers.ninjainvoice-secure.entrypoints=websecure"
      - "traefik.http.routers.ninjainvoice-secure.rule=Host(`in5.REDACTED`)"
      - "traefik.http.routers.ninjainvoice-secure.tls=true"
      - "traefik.http.routers.ninjainvoice-secure.tls.certresolver=myhttpchallenge"
      
      - "traefik.http.routers.ninjainvoice-secure.middlewares=https-sslheaders"
      - "traefik.http.middlewares.https-sslheaders.headers.accesscontrolallowcredentials=true"
      - "traefik.http.middlewares.https-sslheaders.headers.forcestsheader=true"
      - "traefik.http.middlewares.https-sslheaders.headers.browserXSSFilter=true"
      - "traefik.http.middlewares.https-sslheaders.headers.STSIncludeSubdomains=true"
      - "traefik.http.middlewares.https-sslheaders.headers.STSPreload=true"
    networks:
      proxy:
      db_internal:

  app_invoiceninja:
    image: *ninja
    volumes:
      - /share/CACHEDEV4_DATA/KVM/Docker/Volumes/ninja/app/public:/var/www/app/public
      - /share/CACHEDEV4_DATA/KVM/Docker/Volumes/ninja/app/storage:/var/www/app/storage
    depends_on:
      - db_invoiceninja
    environment:
      - APP_URL='http://in5.iking.tk'
      - APP_KEY='base64:pv+REDACTED='
      - APP_ENV=production
      - APP_DEBUG=true
      - DB_HOST1='db_invoiceninja'
      - DB_PORT1='3306'
      - DB_DATABASE1='db-ninja-01'
      - DB_USERNAME1='ninja'
      - DB_PASSWORD1='ninja'
      - MULTI_DB_ENABLED=false
      - PHANTOMJS_PDF_GENERATION=false
      
      - MAIL_MAILER=smtp
      - MAIL_HOST=smtp.gmail.com
      - MAIL_PORT=587
      - MAIL_USERNAME='REDACTED'
      - MAIL_PASSWORD='REDACTED'
      - MAIL_ENCRYPTION='tls'
    networks:
      db_internal:

  db_invoiceninja:
    image: *mysql
    environment:
      MYSQL_ROOT_PASSWORD: REDACTED
      MYSQL_DATABASE: db-ninja-01
      MYSQL_USER: ninja
      MYSQL_PASSWORD: ninja
    networks:
      db_internal:
    volumes:
      - /share/CACHEDEV4_DATA/KVM/Docker/Volumes/ninja/mysql:/var/lib/mysql
      
networks:
  db_internal:
    driver: bridge
    internal: true
    attachable: false
  proxy:
    external: true

I cannot get a pdf to generate to save my life.
/var/www/app/vendor/beganovich/snappdf/versions
only had a readme file.

~/vendor/beganovich/snappdf $ ./snappdf download                                                                                                                                                                                                                                                
PHP Warning:  file_get_contents(https://download-chromium.appspot.com/rev/Linux_x64?type=snapshots): failed to open stream: Operation timed out in /var/www/app/vendor/beganovich/snappdf/src/Command/DownloadChromiumCommand.php on line 70                                                    
PHP Notice:  Trying to get property 'content' of non-object in /var/www/app/vendor/beganovich/snappdf/src/Command/DownloadChromiumCommand.php on line 73                                                                                                                                        
Starting download. Revision:                                                                                                                                                                                                                                                                    
PHP Warning:  fopen(https://download-chromium.appspot.com/dl/Linux_x64?type=snapshots): failed to open stream: Operation timed out in /var/www/app/vendor/beganovich/snappdf/src/Command/DownloadChromiumCommand.php on line 87                                                                 
Download completed. Extracting the zip archive.                                                                                                                                                                                                                                                 
Archive extracted.                                                                                                                                                                                                                                                                              
PHP Warning:  chmod(): No such file or directory in /var/www/app/vendor/beganovich/snappdf/src/Command/DownloadChromiumCommand.php on line 105                                                                                                                                                  
Completed! -Linux_x64 currently in use.  

You shouldn’t have to download the chrome binary as it is included in the standard container.

What error are you seeing when attempting to view a PDF?

504: Gateway Timeout

I wonder if this is an issue with Traeffik?

I can’t recreate the issue using our standard dockerfile.

I spun up a localhost docker-compose and you are correct. everything is working. I will look into traefik and why that is the problem. Does anyone have the labels for traefik and invoiceninja that are working?

@waeking Did you ever figure this out? I am having the same issue, I think: Cannot view or download PDF - mostly stock settings with Docker image