run_occ doesn't support occ flags #58

Open
opened 2026-02-06 19:25:35 +00:00 by fauno · 6 comments
Owner

not even quoting everything like in abra.sh

abra app cmd nube.yanapak.abyaya.la app --  run_occ "maintenance:repair --include-expensive"
su: unrecognized option '--include-expensive'
Try 'su --help' for more information.
FATA
not even quoting everything like in abra.sh ``` abra app cmd nube.yanapak.abyaya.la app -- run_occ "maintenance:repair --include-expensive" su: unrecognized option '--include-expensive' Try 'su --help' for more information. FATA ```
Author
Owner

related: we'd like to run this and the index creation commands during upgrade but i can't find where occ upgrade is being run, is it part of the containers? where should i hook these commands to ensure they're run after a succesful upgrade?

related: we'd like to run this and the index creation commands during upgrade but i can't find where `occ upgrade` is being run, is it part of the containers? where should i hook these commands to ensure they're run after a succesful upgrade?

You should add an extra set of single quotes (I don't know why)
abra app cmd URL app run_occ "'maintenance:repair --include-expensive'"

You should add an extra set of single quotes (I don't know why) `abra app cmd URL app run_occ "'maintenance:repair --include-expensive'"`
Author
Owner

haha thanks, this is... specific. maybe because they're passed to the entrypoint later on?

@decentral1se maybe it's an issue for abra? i'd expect to run commands like in docker exec.

haha thanks, this is... specific. maybe because they're passed to the entrypoint later on? @decentral1se maybe it's an issue for abra? i'd expect to run commands like in docker exec.
Owner

Hard to tell on a quick pass but perhaps a combination of our cursed bash script handling and run_occ doing this:

abra.sh Lines 12 to 14 in 8b7ed8142e
run_occ() {
su -p www-data -s /bin/sh -c "/var/www/html/occ $@"
}

abra runs docker exec under the hood.

Making this less weird would be good!

Hard to tell on a quick pass but perhaps a combination of our cursed bash script handling and `run_occ` doing this: https://git.coopcloud.tech/coop-cloud/nextcloud/src/commit/8b7ed8142e6a492fb107141a163bbec1107bb979/abra.sh#L12-L14 `abra` runs `docker exec` under the hood. Making this less weird would be good!
Author
Owner

like this? using a random container i have running:

function abra-cmd-test { docker exec -it postgis_latest "$@"; }
function abra-cmd-test-2 { abra-cmd-test su -p postgres -s /bin/sh -c "$@" ; }

and then:

abra-cmd-test-2 echo hi # just runs echo, no hi
abra-cmd-test-2 "echo hi" # says hi
abra-cmd-test-2 "echo hi, how are you" # says hi, how are you
abra-cmd-test-2 "ls -hal --color" # works
abra-cmd-test-2 "echo 'hi, how are you' $HOME" # outputs local home
abra-cmd-test-2 'echo hi, how are you $HOME' # outputs container home
abra-cmd-test-2 "ls -hal | grep usr" # pipes also work

it breaks with the double quoting suggested by @jeppebundsgaard so it's different somewhere in abra

like this? using a random container i have running: ```sh function abra-cmd-test { docker exec -it postgis_latest "$@"; } function abra-cmd-test-2 { abra-cmd-test su -p postgres -s /bin/sh -c "$@" ; } ``` and then: ```sh abra-cmd-test-2 echo hi # just runs echo, no hi abra-cmd-test-2 "echo hi" # says hi abra-cmd-test-2 "echo hi, how are you" # says hi, how are you abra-cmd-test-2 "ls -hal --color" # works abra-cmd-test-2 "echo 'hi, how are you' $HOME" # outputs local home abra-cmd-test-2 'echo hi, how are you $HOME' # outputs container home abra-cmd-test-2 "ls -hal | grep usr" # pipes also work ``` it breaks with the double quoting suggested by @jeppebundsgaard so it's different somewhere in abra
Owner

I guess it's time for an abra issue 🙃

I guess it's time for an `abra` issue 🙃
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coop-cloud/nextcloud#58
No description provided.