Skip to content

502 Bad Gateway after first install and reboot VM #6349

Closed as not planned
Closed as not planned

Description

@toptop34

Deployment Method

  • Installer
  • Docker Development
  • Docker Production
  • Bare metal Development
  • Bare metal Production
  • Digital Ocean image
  • Other (please provide a link Steps to Reproduce

Describe the problem*

Hi.
Ubuntu 20.04 Fast install

A quick-and-easy install can be done done with the following one-liner.

wget -qO install.sh https://get.inventree.org && bash install.sh

1 - before you start installation script u need to install curl and gpg...
2 - after all was installed i make reboot and 502 Bad Gateway

How to fixit?

Steps to Reproduce

How to fix this problem?

Relevant log output

No response

Activity

  1. added
    question
    setup
    triage:not-checked
    on Jan 28, 2024
  2. matmair commented on Jan 30, 2024

    @matmair
    Member

    We will need more information, especially the output from the install, the service status output for inventree-web and inventree-worker and the version output from inventree run invoke version

  3. removed
    triage:not-checked
    on Jan 30, 2024
  4. XanderLuciano commented on Mar 9, 2024

    @XanderLuciano
    Contributor

    For anyone who may find this in the future, I had this issue on my first setup attempt. Eventually I realized it was because I had nginx installed on the host machine and I was seeing the 502 nginx error page, NOT an error from inventree.

    I would suggest verifying you don't have any other webservers running on the host machine.

  5. SchrodingersGat commented on Mar 11, 2024

    @SchrodingersGat
    Member

    @XanderLuciano good tip - if there is a conflicting server already running, that will certainly cause problems.

  6. matmair commented on Mar 11, 2024

    @matmair
    Member

    @toptop34 can you confirm this is the issue you are facing too?

  7. StormTrooper commented on Apr 15, 2024

    @StormTrooper

    Seeing the same problem on a fresh install of Ubuntu 20.04 server install.

    systemctl status nginx

     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 Mon 2024-04-15 19:39:38 UTC; 1min 27s ago
           Docs: man:nginx(8)
        Process: 633 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
        Process: 769 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
       Main PID: 781 (nginx)
          Tasks: 2 (limit: 2257)
         Memory: 10.4M
         CGroup: /system.slice/nginx.service
                 ├─781 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
                 └─782 nginx: worker process
    
    Apr 15 19:39:36 inventree-new systemd[1]: Starting A high performance web server and a reverse proxy server...
    Apr 15 19:39:38 inventree-new systemd[1]: Started A high performance web server and a reverse proxy server.
    

    systemctl status inventree-web

    inventree-web.service
         Loaded: loaded (/etc/systemd/system/inventree-web.service; enabled; vendor preset: enabled)
         Active: active (running) since Mon 2024-04-15 19:39:36 UTC; 1min 36s ago
       Main PID: 624 (sleep)
          Tasks: 1 (limit: 2257)
         Memory: 212.0K
         CGroup: /system.slice/inventree-web.service
                 └─624 /bin/sleep infinity
    
    Apr 15 19:39:36 inventree-new systemd[1]: Started inventree-web.service.
    

    systemctl status inventree-worker

    inventree-worker.service
         Loaded: loaded (/etc/systemd/system/inventree-worker.service; enabled; vendor preset: enabled)
         Active: active (running) since Mon 2024-04-15 19:39:36 UTC; 1min 51s ago
       Main PID: 628 (sleep)
          Tasks: 1 (limit: 2257)
         Memory: 220.0K
         CGroup: /system.slice/inventree-worker.service
                 └─628 /bin/sleep infinity
    

    inventree run invoke version

    InvenTree - inventree.org
    The Open-Source Inventory Management System
    
    
    Installation paths:
    Base        /opt/inventree
    Config      /etc/inventree/config.yaml
    Media       /opt/inventree/data/media
    Static      /opt/inventree/data/static
    
    Versions:
    Python      3.9.5
    Django      4.2.11
    InvenTree   0.15.0 dev
    API         187
    Node        N/A
    Yarn        N/A
    
    Commit hash:None
    Commit date:None
    
    

    Install goes through without any errors and at the end of the install it says browse to:
    http://192.168.1.66

    Tried browing there (also tried rebooting) and get

    502 Bad Gateway
    nginx/1.18.0 (Ubuntu)

    I've checked and nginx was not present prior to the inventree install.

  8. StormTrooper commented on Apr 15, 2024

    @StormTrooper

    @matmair Found the issue which caused my problem. Not sure if it's specific to stable or a bug in the master. (I installed master)

    During the install process this file is created:

    /opt/inventree/vendor/pkgr/processes/worker
    

    Which has a typo in it:

    exec env/bin/python src/backendInvenTree/manage.py qcluster 
    

    Inserting a slash between backend and InvenTree fixes this issue for me.

  9. va7wv commented on Apr 17, 2024

    @va7wv

    Same problem here today. I'm so lost on this now. How is anyone installing this?

    Fresh Ubuntu Server 20.04 install. Nothing else done except run the install script with wget. Python venv problem?

    ./worker: 2: exec: env/bin/python: not found
    

    Syslog:

    Apr 17 03:39:52 inventory inventree-web-1.service[903]: /opt/inventree/vendor/pkgr/processes/web: 2: exec: env/bin/gunicorn: not found
    Apr 17 03:39:52 inventory systemd[1]: inventree-web-1.service: Main process exited, code=exited, status=127/n/a
    Apr 17 03:39:52 inventory systemd[1]: inventree-web-1.service: Failed with result 'exit-code'.
    Apr 17 03:39:52 inventory inventree-worker-1.service[904]: /opt/inventree/vendor/pkgr/processes/worker: 3: exec: env/bin/python: not found
    Apr 17 03:39:52 inventory systemd[1]: inventree-worker-1.service: Main process exited, code=exited, status=127/n/a
    Apr 17 03:39:52 inventory systemd[1]: inventree-worker-1.service: Failed with result 'exit-code'.
    
  10. github-actions commented on Jun 16, 2024

    @github-actions
    Contributor

    This issue seems stale. Please react to show this is still important.

  11. added
    inactive
    on Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    inactiveinstallerquestionsetup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions