Upgrade to V5 and change dockerimage

Helo everybody,

I would like to upgrade my IN to v5, but to do that I have to change the dockerimage since i’m using an older image which doesn’t get updated anymore (anojht/invoiceninja:latest). When I started with IN, I didn’t have a lot of docker knowledge, and I don’t know why I chose that image. I already made an sql dump, backuped the local storage and public folders and created an json backup in IN webgui. When I change the dockerimage to invoiceninja/invoiceninja:latest it goes wrong:
Docker log:

2021-11-02T14:33:07Z [INFO] [Entrypoint]: Initialising Invoice Ninja...
Configuration cache cleared!
Configuration cached successfully!
Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!
Routes cached successfully!
Files cached successfully!

Migrating: 2014_10_12_100000_create_password_resets_table


In Connection.php line 703:

                                                                               

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'password_re  

  sets' already exists (SQL: create table `password_resets` (`email` varchar(  

  128) not null, `token` varchar(255) not null, `created_at` timestamp null)   

  default character set utf8mb4 collate 'utf8mb4_unicode_ci' engine = InnoDB)  
                                                                              
In Connection.php line 492:
                                                                              

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'password_re  

  sets' already exists                                                         
                                                                             
2021-11-02T14:33:11Z [INFO] [Entrypoint]: Initialising Invoice Ninja...                                                         

What are my correct steps to upgade my IN succesfully? I’m not using docker compose. I have a seperate mariadb docker with my database.

Regards,

Rick

Hi,

I’m not sure, one option may be to setup a new install of v4 and then copy over the original v4 database with mysqldump and .env file.

So create a new database, create a new docker with invoiceninja/invoiceninja, using the new database. Then after the install restore the database from my old invoiceninja with the wrong image with the new database and then try to upgade to V5? I’m not using an .env file, my environment variables are directly entered when I create the docker in portainer.

That sounds about right

So I installed a fresh docker using the latest invoiceninja/invoiceninja, but i’m greeted with an 502 Bad Gateway error, i’m not getting to the setup page. I have an nginx server running which is using proxy_pass to the dockerserver with invoiceninja installed. I also already setup trusted_proxies in my env variables

Logs:
InvoiceNinja docker log:

2021-11-04T09:32:57Z [INFO] [Entrypoint]: Initialising Invoice Ninja...
Configuration cache cleared!
Configuration cached successfully!
Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!
Routes cached successfully!
Files cached successfully!
Nothing to migrate.
2021-11-04 09:32:59,584 WARN For [program:php-fpm], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored
2021-11-04 09:32:59,584 WARN For [program:scheduler], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored
2021-11-04 09:32:59,584 WARN For [program:queue-worker], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored
2021-11-04 09:32:59,584 WARN For [program:queue-worker], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored
2021-11-04 09:32:59,586 INFO supervisord started with pid 1
2021-11-04 09:33:00,589 INFO spawned: 'shutdown' with pid 76
2021-11-04 09:33:00,591 INFO spawned: 'php-fpm' with pid 77
2021-11-04 09:33:00,594 INFO spawned: 'queue-worker_00' with pid 78
2021-11-04 09:33:00,596 INFO spawned: 'queue-worker_01' with pid 79
2021-11-04 09:33:00,598 INFO spawned: 'scheduler' with pid 80
READY
[04-Nov-2021 09:33:00] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[04-Nov-2021 09:33:00] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[04-Nov-2021 09:33:00] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[04-Nov-2021 09:33:00] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[04-Nov-2021 09:33:00] NOTICE: fpm is running, pid 77
[04-Nov-2021 09:33:00] NOTICE: ready to handle connections
Schedule worker started successfully.
2021-11-04 09:33:01,935 INFO success: shutdown entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-11-04 09:33:01,935 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-11-04 09:33:01,936 INFO success: queue-worker_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-11-04 09:33:01,936 INFO success: queue-worker_01 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-11-04 09:33:01,936 INFO success: scheduler entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
[2021-11-04T09:34:00+00:00] Execution #1 output:
No scheduled commands are ready to run.
[2021-11-04T09:35:00+00:00] Execution #2 output:
[2021-11-04T09:35:00+00:00] Running scheduled command: Callback
[2021-11-04T09:36:00+00:00] Execution #3 output:
No scheduled commands are ready to run.
[2021-11-04T09:37:00+00:00] Execution #4 output:
No scheduled commands are ready to run.
[2021-11-04T09:38:00+00:00] Execution #5 output:
No scheduled commands are ready to run.
[2021-11-04T09:39:00+00:00] Execution #6 output:
No scheduled commands are ready to run.
[2021-11-04T09:40:00+00:00] Execution #7 output:
[2021-11-04T09:40:00+00:00] Running scheduled command: Callback
[2021-11-04T09:41:00+00:00] Execution #8 output:
No scheduled commands are ready to run.
[2021-11-04T09:42:00+00:00] Execution #9 output:
No scheduled commands are ready to run.
[2021-11-04T09:43:00+00:00] Execution #10 output:
No scheduled commands are ready to run.
[2021-11-04T09:44:00+00:00] Execution #11 output:
No scheduled commands are ready to run.
[2021-11-04T09:45:00+00:00] Execution #12 output:
[2021-11-04T09:45:00+00:00] Running scheduled command: Callback
[2021-11-04T09:46:00+00:00] Execution #13 output:
No scheduled commands are ready to run.

There are no log files in my storage or public folders, there are no files at all in those folders.

My nginx config:

#INVOICENINJA CONTAINER
server {
listen 80;
server_name invoice.mydomain.nl;
return 301 https://$server_name$request_uri;
}

server {
listen 443 ssl http2;
server_name invoice.mydomain.nl;

#SSL settings
include /config/nginx/ssl.conf;

#Maxmind geoblock
#include /config/nginx/geoblock.conf;

location / {
proxy_pass  http://10.0.0.104:8001;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

Do you have any idea what i’m doing wrong?

@david do you have any ideas?

Any ideas on this problem?

@rvoosterhout

Are you using the exact dockerfile from our repo or have you rolled your own?

I would suggest using the default docker images, as that is about as far as our expertise goes.

Yes, I’m using the invoiceninja/invoiceninja container.

Any ideas on this problem?

@rvooosterhout

I’m not sure on this, I’m not really a Docker expert unfortunately.