Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] occ commands don't work #338

Closed
1 task done
zedred79 opened this issue Jul 22, 2023 · 5 comments
Closed
1 task done

[BUG] occ commands don't work #338

zedred79 opened this issue Jul 22, 2023 · 5 comments

Comments

@zedred79
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I updated nexcloud to version 27.01 and there were no problems. Now I have to run the occ db:add-missing-indices command but I can’t.

Before I always used the command:
sudo docker exec -u abc -it nextcloud php occ db:add-missing-indices

or

sudo docker exec -it nextcloud /bin/bash
cd /config/www/nextcloud
sudo -u abc php occ occ db:add-missing-indices

Now the result is:
Could not open input file: occ

Expected Behavior

No response

Steps To Reproduce

sudo docker exec -u abc -it nextcloud php occ db:add-missing-indices

Environment

- OS: ubuntu 22.04.2 LTS
- How docker service was installed: docker-compose

CPU architecture

x86-64

Docker creation

nextcloud:
    image: lscr.io/linuxserver/nextcloud
    container_name: nextcloud
    depends_on:
      - mariadb
      - swag
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Rome
    volumes:
      - /config/nextcloud:/config
      - /dati/nextcloud:/data
    ports:
      - 450:443
    restart: unless-stopped

Container logs

[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
using keys found in /config/keys
Initializing nextcloud 27.0.1.2 (this can take a while) ...
Upgrading nextcloud from 27.0.0.8 ...
Setting permissions
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Turned on maintenance mode
Updating database schema
Updated database
Disabled incompatible app: carnet
Disabled incompatible app: recognize
Updating <oauth2> ...
Updated <oauth2> to 1.15.1
Updating <circles> ...
Updated <circles> to 27.0.1
Starting code integrity check...
Finished code integrity check
Update successful
Turned off maintenance mode
Resetting log level
Initializing finished
[custom-init] No custom files found, skipping...
[ls.io-init] done.
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
usermod: no changes
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
using keys found in /config/keys
[custom-init] No custom files found, skipping...
[ls.io-init] done.
@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@j0nnymoe
Copy link
Member

All you need to from within the container is start the command with occ <options>

@zedred79
Copy link
Author

All you need to from within the container is start the command with occ <options>

too easy, thank you so much

@tuetenk0pp
Copy link

All you need to from within the container is start the command with occ <options>

Does that mean that there's no need for the sudo -u abc part of the command? It is save to run it as root?

@nemchik
Copy link
Member

nemchik commented Aug 22, 2023

All you need to from within the container is start the command with occ <options>

Does that mean that there's no need for the sudo -u abc part of the command? It is save to run it as root?

Correct. We built a command alias in to the container:

sudo -u abc -s /bin/bash -c "php /app/www/public/occ $*"

All you have to do is;
from the host: docker exec -it nextcloud occ <options>
from inside the container occ <options>
whichever method you prefer. There is no need to sudo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants