Skip to content

Install Error using Script #7297

Closed
Closed

Description

@yodaphone

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*

I created a Ubuntu 22.04 VM and ran the installer script. After it said Install done, i restarted the VM & during the bootup process saw that "inventree-web-1.service" & "inventree-worker-1.service" services failed to start

sudo systemctl status inventree-web-1.service
× inventree-web-1.service
     Loaded: loaded (/etc/systemd/system/inventree-web-1.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2024-05-22 01:13:07 UTC; 32s ago
    Process: 995 ExecStart=/usr/bin/inventree run web (code=exited, status=127)
   Main PID: 995 (code=exited, status=127)
        CPU: 51ms

May 22 01:13:07 Inventree systemd[1]: inventree-web-1.service: Scheduled restart job, restart counter is at 5.
May 22 01:13:07 Inventree systemd[1]: Stopped inventree-web-1.service.
May 22 01:13:07 Inventree systemd[1]: inventree-web-1.service: Start request repeated too quickly.
May 22 01:13:07 Inventree systemd[1]: inventree-web-1.service: Failed with result 'exit-code'.
May 22 01:13:07 Inventree systemd[1]: Failed to start inventree-web-1.service.
yodaphone@Inventree:~$ sudo systemctl status inventree-worker-1.service
× inventree-worker-1.service
     Loaded: loaded (/etc/systemd/system/inventree-worker-1.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2024-05-22 01:13:07 UTC; 56s ago
    Process: 997 ExecStart=/usr/bin/inventree run worker (code=exited, status=127)
   Main PID: 997 (code=exited, status=127)
        CPU: 55ms

May 22 01:13:07 Inventree systemd[1]: inventree-worker-1.service: Scheduled restart job, restart counter is at 5.
May 22 01:13:07 Inventree systemd[1]: Stopped inventree-worker-1.service.
May 22 01:13:07 Inventree systemd[1]: inventree-worker-1.service: Start request repeated too quickly.
May 22 01:13:07 Inventree systemd[1]: inventree-worker-1.service: Failed with result 'exit-code'.
May 22 01:13:07 Inventree systemd[1]: Failed to start inventree-worker-1.service.

I have tried to run the installer by creating a user called inventree but its the same issue

i noticed one thing, the automated installer install python3.10 and there is an error "bash: line 1: python3.9: command not found"
when i visit the website i get a "502 Bad Gateway" error

I'm totally new to this and any help will be really appreciated

Steps to Reproduce

Just ran the installer as per the instructions.

Relevant log output

this is the setuplog
# Setting base environment variables
# No config file found: /etc/inventree/config.yaml, using envs or defaults
# Collected environment variables:
#    INVENTREE_MEDIA_ROOT=/opt/inventree/data/media
#    INVENTREE_STATIC_ROOT=/opt/inventree/data/static
#    INVENTREE_BACKUP_DIR=/opt/inventree/data/backup
#    INVENTREE_PLUGINS_ENABLED=true
#    INVENTREE_PLUGIN_FILE=/etc/inventree/plugins.txt
#    INVENTREE_SECRET_KEY_FILE=/etc/inventree/secret_key.txt
#    INVENTREE_DB_ENGINE=sqlite3
#    INVENTREE_DB_NAME=/opt/inventree/data/database.sqlite3
#    INVENTREE_DB_USER=sampleuser
#    INVENTREE_DB_HOST=samplehost
#    INVENTREE_DB_PORT=123456
# Getting the IP address of the server via web service
IP address is x.x.x.x
# Setting up python environment
bash: line 1: python3.9: command not found
bash: line 1: env/bin/pip: No such file or directory
# Unlinking default nginx config\n# Old file still in /etc/nginx/sites-available/default
# Stopping nginx
# Setting up nginx to /etc/nginx/sites-enabled/inventree.conf
# Starting nginx
# (Re)creating init scripts
Created symlink /etc/systemd/system/multi-user.target.wants/inventree.service → /etc/systemd/system/inventree.service.
Created symlink /etc/systemd/system/inventree.service.wants/inventree-web.service → /etc/systemd/system/inventree-web.service.
Scaling up...
Created symlink /etc/systemd/system/inventree-web.service.wants/inventree-web-1.service → /etc/systemd/system/inventree-web-1.service.
--> done.
Created symlink /etc/systemd/system/inventree.service.wants/inventree-worker.service → /etc/systemd/system/inventree-worker.service.
Scaling up...
Created symlink /etc/systemd/system/inventree-worker.service.wants/inventree-worker-1.service → /etc/systemd/system/inventree-worker-1.service.
--> done.
# Enabling InvenTree on boot
# Creating admin user data
# Stopping InvenTree
# Updating InvenTree
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: wheel in /usr/lib/python3/dist-packages (0.37.1)
bash: line 1: invoke: command not found
# Set permissions for data dir and media: /opt/inventree/data
# Setting up InvenTree config values
# Writing the settings to the config file /etc/inventree/config.yaml
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
sed: can't read /etc/inventree/config.yaml: No such file or directory
chown: cannot access '/etc/inventree/config.yaml': No such file or directory
# Starting InvenTree
####################################################################################
This InvenTree install uses nginx, the settings for the webserver can be found in
/etc/nginx/sites-enabled/inventree.conf
Try opening InvenTree with either
http://localhost/ or http://x.x.x.x/

Admin user data:
   Email: [email protected]
   Username: admin
   Password: OpdnpV/xxxxxxxxxxxxxxxx
####################################################################################

Activity

  1. added
    question
    setup
    triage:not-checked
    on May 22, 2024
  2. added and removed
    triage:not-checked
    on May 22, 2024
  3. SchrodingersGat commented on May 22, 2024

    @SchrodingersGat
    Member

    Looks like a number of errors have occurred during the installer process.

    @matmair is it possible to exit the install if any of the subprocesses fail? It appears that the installer carries on regardless, giving users the apperance that it has "worked"...

  4. mugane-dj commented on May 22, 2024

    @mugane-dj

    I experienced the same issue when running apt install --only-upgrade inventree. I used installer on the first installation. Below are some error traces:

    ERROR: Could not open requirements file: [Errno 2] No such file or directory: '/opt/inventree/.github/requirements.txt'
    
      File "/opt/inventree/env/lib/python3.8/site-packages/django/core/management/__init__.py", line 237, in fetch_command
        app_name = commands[subcommand]
    KeyError: 'dbbackup'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "manage.py", line 24, in <module>
        main()
      File "manage.py", line 20, in main
        execute_from_command_line(sys.argv)
      File "/opt/inventree/env/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
        utility.execute()
      File "/opt/inventree/env/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/opt/inventree/env/lib/python3.8/site-packages/django/core/management/__init__.py", line 244, in fetch_command
        settings.INSTALLED_APPS
      File "/opt/inventree/env/lib/python3.8/site-packages/django/conf/__init__.py", line 82, in __getattr__
        self._setup(name)
      File "/opt/inventree/env/lib/python3.8/site-packages/django/conf/__init__.py", line 69, in _setup
        self._wrapped = Settings(settings_module)
      File "/opt/inventree/env/lib/python3.8/site-packages/django/conf/__init__.py", line 170, in __init__
        mod = importlib.import_module(self.SETTINGS_MODULE)
      File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
      File "<frozen importlib._bootstrap>", line 991, in _find_and_load
      File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 848, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/opt/inventree/src/backend/InvenTree/InvenTree/settings.py", line 26, in <module>
        from dotenv import load_dotenv
    ModuleNotFoundError: No module named 'dotenv'
    
    
  5. added
    bug
    on May 22, 2024
  6. SchrodingersGat commented on May 22, 2024

    @SchrodingersGat
    Member

    Looks like the python requirements are not being installed... @matmair is there any way for users to bypass the incorrect path for the requirements file?

  7. matmair commented on May 23, 2024

    @matmair
    Member

    No the requirements are needed for the install process.

  8. SchrodingersGat commented on May 26, 2024

    @SchrodingersGat
    Member

    Ref: #7336

  9. matmair commented on May 27, 2024

    @matmair
    Member

    @yodaphone can you confirm this was resolved with the latest update?

  10. self-assigned this
    on May 27, 2024
  11. added this to the 0.15.3 milestone on May 27, 2024
  12. removed
    question
    on May 27, 2024
  13. second-string commented on May 27, 2024

    @second-string

    I just ran the install script on a freshly spun-up server and I'm still hitting some of the same errors.

    No python environment found - using python3.9
    # Setting up python environment
    bash: line 1: python3.9: command not found
    bash: line 1: env/bin/pip: No such file or directory
    

    and

    # Updating InvenTree
    Defaulting to user installation because normal site-packages is not writeable
    Requirement already satisfied: wheel in /usr/lib/python3/dist-packages (0.37.1)
    bash: line 1: invoke: command not found
    # Set permissions for data dir and media: /opt/inventree/data
    chown: cannot access '/opt/inventree/data': No such file or directory
    # Setting up InvenTree config values
    # Writing the settings to the config file /etc/inventree/config.yaml
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    sed: can't read /etc/inventree/config.yaml: No such file or directory
    chown: cannot access '/opt/inventree/data': No such file or directory
    chown: cannot access '/etc/inventree/config.yaml': No such file or directory
    # Setting up InvenTree site URL
    

    I think in my last install I had to manually copy the data folder in from the repo or maybe the docker image myself, and I tweaked my own nginx config but don't know if that was due to install or just I did it to match what I wanted better. Are we supposed to set up a python virtual env with python3.9 on the path before we run the install script?

  14. matmair commented on May 27, 2024

    @matmair
    Member

    @second-string are you running on ubuntu 22.04 using the installer script too? If not I would appreciate a separate bug report

  15. second-string commented on May 27, 2024

    @second-string

    Yes also on 22.04. Do you want a fully separate issue or just a full log from me?

  16. matmair commented on May 27, 2024

    @matmair
    Member

    And you are using the installer script - you are mentioning copying data and docker stuff, which has nothing to do with the installer script

  17. yodaphone commented on May 27, 2024

    @yodaphone
    Author

    @yodaphone can you confirm this was resolved with the latest update?

    Hi matthias, i havent tried again as i moved on to a docker based install. but will try it once again, please give me a day or 2

  18. removed their assignment
    on May 27, 2024
  19. second-string commented on May 28, 2024

    @second-string

    And you are using the installer script - you are mentioning copying data and docker stuff, which has nothing to do with the installer script

    Yes correct. I realised after I posted my comment that my previous install was done bare metal manually, because I couldn't get the install script working ~a few months ago either. No docker for my actual install ever, I might have just pulled that container to get the proper data files for the frontend. I can't remember if I got them from there or straight from the repo, I just remember that I had to manually download and copy them in.

  20. mugane-dj commented on May 29, 2024

    @mugane-dj

    @SchrodingersGat The install script worked on Ubuntu 20.04 on my side.

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

    buginstallersetup

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions