You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
502 Bad Gateway after ubuntu 20 upgrade Inventree 0.15.1 #7246
after runnig sudo apt update && sudo apt upgrade and rebooting my Ubuntu 20 machin i am no longer able to connect to inventree. not remote nor local.
i get :
You need to check the startup logs of inventree (wherever they may be in your particular case). Error 502 means that nginx wasn't able to connect to the inventree backend, which may in turn mean that it's not even starting.
This is all specific to your particular setup. Since nobody knows the details of how it is configured in your case, it is not likely that someone will be able to give a useful answer. There are many possible ways to start the inventree processes and save (or not save) their logs.
It's best to ask the person who configured it, or consult the manual/guide which was used to set it up.
I can partly understand but as mentioned im a user and yes i installed inventree myself on a bare ubuntu system.
Its been working well for me so far.
I did nit make any changes would not even know how to. I just followed the baremetal installer instructions.
That said I assume there are default locations where inventree stores this log.
You also refer to a manual where should i be able to find this?
Alternatively there will also be a config somewhere that instructs Inventree how to act where to store its data where to save its logs etc.
Can you guide me there? Or pint me to someone that provides helps a s a service? Im based in the Netherlands if that helps.
they mention: sudo systemctl status php7.4-fpm which is not running on my machine:
sudo systemctl status php7.4-fpm
Unit php7.4-fpm.service could not be found.
But than i'm not sure if its required or not for inventree.
meanwhile i have also tried reinstalling Inventree ( sudo wget -qO install.sh https://get.inventree.org && bash install.sh )
but also that did not resolve my issue.
im comparing my systemctl status nginx.service output with yours but im missing the processes part between docs and main PID.
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2024-05-21 09:21:30 CEST; 2 days ago
Docs: man:nginx(8)
Process: 291 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 297 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 298 (nginx)
CGroup: /system.slice/nginx.service
├─298 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
├─299 nginx: worker process
├─300 nginx: worker process
├─301 nginx: worker process
└─302 nginx: worker process
mei 21 09:12:18 server systemd[1]: Stopping A high performance web server and a reverse proxy server...
mei 21 09:12:18 server systemd[1]: nginx.service: Succeeded.
mei 21 09:12:18 server systemd[1]: Stopped A high performance web server and a reverse proxy server.
mei 21 09:12:18 server systemd[1]: Starting A high performance web server and a reverse proxy server...
mei 21 09:12:18 server systemd[1]: Started A high performance web server and a reverse proxy server.
mei 21 09:19:03 server systemd[1]: Stopping A high performance web server and a reverse proxy server...
mei 21 09:19:03 server systemd[1]: nginx.service: Succeeded.
I have Inventree working again on my ubuntu 22.04 baremetal.
together with @asscherhofstede we had a debug session and found that installing on a new machine (Manual Install ) the out of the box was also not working.
also there we had to uncomment line 88 as stated above.
next i tried copying my files from the 'broken machine' o the new ubuntu 20. i.e.
copied /opt/inventree/data that broke it again.
eventually i compared /etc/inventree/config.yaml between the 2 machines and found that on the 'broken' machine all path settings where modified after the update.
correcting this than it worked on both machines.
so up and running again.
Thanx guys for the support
next step now is to relocate my db and other relevant files to an external machine like dropbox or NAS.
and then remove Inventree from the machine and reisntall ubuntu and inventree again to have a clean machine.
Additionally after i got it working i got the notification:
so i did: sudo systemctl stop inventree next sudo inventree run invoke update and finally sudo systemctl start inventree
but after migration it mentioned:
InvenTree database migrations completed!
Updating frontend...
Downloading frontend...
fatal: not a git repository (or any of the parent directories): .git
[ERROR] Cannot get current ref via 'git rev-parse HEAD'
even thought this reporting it all seems to be working.
Activity
shapirus commentedon May 16, 2024
You need to check the startup logs of inventree (wherever they may be in your particular case). Error 502 means that nginx wasn't able to connect to the inventree backend, which may in turn mean that it's not even starting.
mabroens commentedon May 17, 2024
@shapirus thank you for the hint. But i am just a user of the system. Could you give me a few more hints on what or where i should look.
I found in /opt/inventree/log a setup_xxx.log file from yesterday but i could not find startup logs.
I have checked the status for ngunx but that seems to be running.
Any hints pls i really need inventree to be up and running again.
Br Martijn
shapirus commentedon May 17, 2024
This is all specific to your particular setup. Since nobody knows the details of how it is configured in your case, it is not likely that someone will be able to give a useful answer. There are many possible ways to start the inventree processes and save (or not save) their logs.
It's best to ask the person who configured it, or consult the manual/guide which was used to set it up.
mabroens commentedon May 17, 2024
I can partly understand but as mentioned im a user and yes i installed inventree myself on a bare ubuntu system.
Its been working well for me so far.
I did nit make any changes would not even know how to. I just followed the baremetal installer instructions.
That said I assume there are default locations where inventree stores this log.
You also refer to a manual where should i be able to find this?
Alternatively there will also be a config somewhere that instructs Inventree how to act where to store its data where to save its logs etc.
Can you guide me there? Or pint me to someone that provides helps a s a service? Im based in the Netherlands if that helps.
Br martijn
mabroens commentedon May 20, 2024
Question,
i'm still not able to get Inventree up. and was googliong on nginx error debugging etc. and found:https://www.linuxbabe.com/linux-server/how-to-fix-common-nginx-errors
they mention: sudo systemctl status php7.4-fpm which is not running on my machine:
But than i'm not sure if its required or not for inventree.
meanwhile i have also tried reinstalling Inventree (
sudo wget -qO install.sh https://get.inventree.org && bash install.sh)but also that did not resolve my issue.
any hints help is very much apreciated.
br martijn
SchrodingersGat commentedon May 20, 2024
Can you share the logs here? Where there any error messages present in those logs?
mabroens commentedon May 20, 2024
Hi Oliver,
thanks :-)
these are the latest files:
and the content of setup_2024-05-16_19_05_43.log.1
Pls let me know if you require more.
Br Martijn
SchrodingersGat commentedon May 20, 2024
@matmair the error message at the start of the log looks suspicious to me:
Is this potentially a mangled path in the installer since we split the source code into the new directories?
asscherhofstede commentedon May 21, 2024
have the same issue with a fresh install on a vm, within the logs i only found user warnings. not that he couldnt find the requirements.txt.
asscherhofstede commentedon May 21, 2024
config file /etc/inventree/config.yaml
Just fixed my error. in the config there is a line for INVENTREE_SITE_URL:

uncomment that, that was my problem it couldnt find a base url.
24 remaining items
asscherhofstede commentedon May 23, 2024
maybe there is a another ngix running on port you wanna use.
you can check with:
sudo lsof -i:{hereyourport}im on port 80
and this is my output
im comparing my
systemctl status nginx.serviceoutput with yours but im missing the processes part between docs and main PID.mabroens commentedon May 23, 2024
this is what i get when excuting these 2 commands
mabroens commentedon May 25, 2024
I have Inventree working again on my ubuntu 22.04 baremetal.
together with @asscherhofstede we had a debug session and found that installing on a new machine (Manual Install ) the out of the box was also not working.
also there we had to uncomment line 88 as stated above.
next i tried copying my files from the 'broken machine' o the new ubuntu 20. i.e.
copied /opt/inventree/data that broke it again.
eventually i compared /etc/inventree/config.yaml between the 2 machines and found that on the 'broken' machine all path settings where modified after the update.
correcting this than it worked on both machines.
so up and running again.
Thanx guys for the support
mabroens commentedon May 25, 2024
next step now is to relocate my db and other relevant files to an external machine like dropbox or NAS.
and then remove Inventree from the machine and reisntall ubuntu and inventree again to have a clean machine.
Br Martijn
SchrodingersGat commentedon May 26, 2024
Ref: #7336
SchrodingersGat commentedon May 26, 2024
@mabroens ok thank you for prodiving that extra information. We can use that to work out our fix for the installer.
(@matmair )
mabroens commentedon May 26, 2024
Additionally after i got it working i got the notification:

so i did:
sudo systemctl stop inventreenextsudo inventree run invoke updateand finallysudo systemctl start inventreebut after migration it mentioned:
even thought this reporting it all seems to be working.
Br Martijn
SchrodingersGat commentedon May 26, 2024
@mabroens thanks for adding in that additional detail, I'll make a note of it.
matmair commentedon May 27, 2024
Seems like the original issue was resolved - can we close this @mabroens?
mabroens commentedon May 27, 2024
yes we can thank you