500 error with v5 install using docker

I’m trying to install IN v5 on my RPI 4 using docker.

I followed the instructions on GitHub and it looks like everything installed correctly. When I go the IP address and port to open IN (http://10.10.1.3:8003) I get this error message.

Internal Server Error

# Unsupported cipher or incorrect key length. Supported ciphers are: aes-128-cbc, aes-256-cbc, aes-128-gcm, aes-256-gcm

Pipeline->Illuminate\Pipeline\{closure}(*object*(Request))in [/var/www/app/app/Http/Middleware/**Cors.php** ](http://10.10.1.3:8003/)(line 24)

19. `            ];`
20. ``
21. `            return Response::make('OK', 200, $headers);`
22. `        }`
23. ``
24. `        $response = $next($request);`
25. ``
26. `        $response->headers->set('Access-Control-Allow-Origin', '*');`
27. `        $response->headers->set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');`
28. `        $response->headers->set('Access-Control-Allow-Headers', 'X-React,X-API-PASSWORD-BASE64,X-API-COMPANY-KEY,X-API-SECRET,X-API-TOKEN,X-API-PASSWORD,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Disposition,Range,X-CSRF-TOKEN,X-XSRF-TOKEN,X-LIVEWIRE');`
29. `        $response->headers->set('Access-Control-Expose-Headers', 'X-APP-VERSION,X-MINIMUM-CLIENT-VERSION,Content-Disposition');`

Here is my env file

# IN application vars
APP_URL=http://10.10.1.3:8003/
APP_KEY=purposlyremoved
APP_DEBUG=true
REQUIRE_HTTPS=false
PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=snappdf
TRUSTED_PROXIES='*'

QUEUE_CONNECTION=database

# DB connection
DB_HOST=db
DB_PORT=3306
DB_DATABASE=ninja
DB_USERNAME=ninja
DB_PASSWORD=ninja

# Create initial user
# Default to these values if empty
IN_USER_EMAIL=myemail@address.com
IN_PASSWORD=mypassword

# 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='myemail@address.com'
MAIL_FROM_NAME='mycompany'

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

# V4 env vars
# DB_STRICT=false
# APP_CIPHER=AES-256-CBC

Here is my docker-compose.yml

version: '3.7'

services:
  server:
    image: nginx
    restart: always
    env_file: env
    volumes:
      # Vhost configuration
      #- ./config/caddy/Caddyfile:/etc/caddy/Caddyfiledocker-com
      - ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
      - ./docker/app/public:/var/www/app/public:ro
    depends_on:
      - app
    # Run webserver nginx on port 80
    # Feel free to modify depending what port is already occupied
    ports:
      - "8003:80"
      #- "443:443"
    networks:
      - invoiceninja
    extra_hosts:
      - "in5.localhost:192.168.0.124 " #host and ip

  app:
    image: invoiceninja/invoiceninja:5
    env_file: env
    restart: always
    volumes:
      - ./config/hosts:/etc/hosts:ro
      - ./docker/app/public:/var/www/app/public:rw,delegated
      - ./docker/app/storage:/var/www/app/storage:rw,delegated
      - ./config/php/php.ini:/usr/local/etc/php/php.ini
      - ./config/php/php-cli.ini:/usr/local/etc/php/php-cli.ini
  depends_on:
      - db
    networks:
      - invoiceninja
    extra_hosts:
      - "in5.localhost:192.168.0.124 " #host and ip

  db:
#    image: mysql:8
#    When running on ARM64 use MariaDB instead of MySQL
    image: mariadb:10.4
#    For auto DB backups comment out image and use the build block below
#    build:
#      context: ./config/mysql
    ports:
      - "3305:3306"
    restart: always
    env_file: env
    volumes:
      - ./docker/mysql/data:/var/lib/mysql:rw,delegated

      # remove comments for next 4 lines if you want auto sql backups
      #- ./docker/mysql/bak:/backups:rw
      #- ./config/mysql/backup-script:/etc/cron.daily/daily:ro
      #- ./config/mysql/backup-script:/etc/cron.weekly/weekly:ro
      #- ./config/mysql/backup-script:/etc/cron.monthly/monthly:ro
    networks:
      - invoiceninja
    extra_hosts:
      - "in5.localhost:192.168.0.124 " #host and ip

  # THIS IS ONLY A VALID CONFIGURATION FOR IN 4. DO NOT USE FOR IN 5.
  # cron:
  #   image: invoiceninja/invoiceninja:alpine-4
 #   volumes:
      # - ./docker/app/public:/var/www/app/public:rw,delegated
      # - ./docker/app/storage:/var/www/app/storage:rw,delegated
      # - ./docker/app/public/logo:/var/www/app/public/logo:rw,delegated
  #   entrypoint: |
  #     /bin/sh -c 'sh -s <<EOF
  #     trap "break;exit" SIGHUP SIGINT SIGTERM
  #     sleep 300s
  #     while /bin/true; do
  #       ./artisan ninja:send-invoices
  #       ./artisan ninja:send-reminders
  #       sleep 1d
  #     done
  #     EOF'
  #   networks:
  #     - invoiceninja
  #

networks:
  invoiceninja:

Hi,

In general you can run php artisan key:generate to set a new key but I’m not sure if that’s supported with Docker.

@david do you have any suggestions?

That command isn’t supported but, per the instructions on GitHub this command created the initial key that I used.

docker run --rm -it invoiceninja/invoiceninja php artisan key:generate --show

Anyone here have any thoughts on this? I followed the instructions provided twice and still have the exact same problem.

Thank you.

@peschelnet I’m not sure if it’s legacy from old time, but I’m running my docker-compose with this in my .env and have no problem running it (other than a newly diskspace problem - not related :stuck_out_tongue: )

APP_CIPHER=AES-256-CBC

Maybe this will help / change your problem - and here is a full dump of what is diffences from your/github .env file - don’t remember 1-2 years back what is the reason for my putting them in or if they have been removed in the meantime and I just have them as legacy variables…

APP_ENV=production
APP_CIPHER=AES-256-CBC
APP_LOCALE=en
IS_DOCKER=true

Hope it might help you…

1 Like

Thanks for the help.

Unfortunately, it just changed the problem to now I get a blank page :confused:

Sorry for the delayed answer… what is the output in the container log? and also /storage/logs/laravel.log ???