Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. SOLVED: Cannot run openproject command from cli

SOLVED: Cannot run openproject command from cli

Added by John Mink over 1 year ago

I am trying to run OpenProject on a minimal Ubuntu install (so it's possible there's a dependency I'm missing, please ask!), and the installation seems successful.  However I am stuck when I try to run the openproject configure command as it does not want to run.  Please see output below:

root@4cf251a71cd3:/etc/openproject# openproject configure
Error: You must be executing as the user 'openproject' or with root privileges to launch commands.
Either log in as 'openproject', root, use sudo, or add sudo privileges for running openproject with your current user.

openproject@4cf251a71cd3:/etc/openproject$ sudo openproject configure
Error: You must be executing as the user 'openproject' or with root privileges to launch commands.
Either log in as 'openproject', root, use sudo, or add sudo privileges for running openproject with your current user.

openproject@4cf251a71cd3:/etc/openproject$ openproject configure
Error: You must be executing as the user 'openproject' or with root privileges to launch commands.
Either log in as 'openproject', root, use sudo, or add sudo privileges for running openproject with your current user.



openproject@4cf251a71cd3:/etc/openproject$ id
uid=999(openproject) gid=999(openproject) groups=999(openproject),27(sudo)

root@4cf251a71cd3:/etc/openproject# which openproject
/usr/bin/openproject

root@4cf251a71cd3:/etc/openproject# ls -al /usr/bin/openproject
-rwxr-xr-x 1 root root 15098 Jul 18 04:56 /usr/bin/openproject

Note:  For installation I used the "package manager installation for Ubuntu 22.04" as described on https://www.openproject.org/docs/installation-and-operations/installation/packaged/

Update:

I tried making a change to ./usr/bin/openproject  (the result of which openproject as it turns out it's just a bash script) by adding the following line echo "You are currently running as $(id -u)" as shown below

# Some actions require root privileges
ensure_root() {
 if [ $(id -u) -ne 0 ]; then
   echo "Error: You must be executing with root privileges to use this command."
   echo "Either log in as root, use sudo, or add sudo privileges for running ${APP_NAME} with your user."
   echo "You are currently running as $(id -u)"
   exit 1
 fi
}

As a sanity check, I ran this and got 0, as expected.

~~root@004ccc63bdc2:/# id -u~~
~~0~~

I'm confused as to why, when I run ~~openproject configure~~ I don't see the debug line I added despite it being saved in the file.  In fact, no changes to the file seem to be taking.  Any insight as to why this is would be greatly appreciated!

Update #2:

I missed line 82 has a similar command where it checks for root OR app_user (hence why it doesn't call the check_root function).  Adding my line there provides the output as expected.


Replies (2)

Incomplete Solution - Added by John Mink over 1 year ago

There are two things you can do that seemingly allow you to continue.

  1. Import an existing config file as this bypasses the check.
  2. comment out the exit 1 command in the check.

Obviously these are incomplete solutions that will likely cause errors down the line, but without more insight I'm at a loss for a more robust solution.

RE: Incomplete Solution - Added by John Mink over 1 year ago

Update in case anyone else (including future me) stumbles across this issue.

The problem is I was attempting to automate too much and overwrote the entire /etc/openproject/ folder (except the installer.dat) when moving the installer.dat into that file.

  • (1 - 2/2)
Loading...