NC VM Appliance 20.0.5 no OCC

Hello,

I have a NC20.0.5 Appliance Installation.

We have some database issues, but i have no OCC installed.
How can i fix this problems?
The first installation of this Appliance was version NC20.

Thank you for help and best regards

2021-01-19 09_38_46

grafik

the text is missleading. occ is not a command. it’s a php skript in your nextcloud folder.

you have to run php.

sudo -u www-data php /var/www/nextcloud/occ ....

I’m sorry, i am not deep linux nor php admin. this was the first useful hint from you. :slight_smile:

i tried it like this:

sudo -u www-data php /var/www/nextcloud/occ occ db:add-missing-indices

root@nextcloud:~# sudo -u www-data php /var/www/nextcloud/occ occ db:add-missing-indices
PHP Warning: require_once(/var/www/nextcloud/console.php): failed to open stream: No such file or directory in /var/www/nextcloud/occ on line 11
PHP Fatal error: require_once(): Failed opening required ‘/var/www/nextcloud/console.php’ (include_path=’.:/usr/share/php’) in /var/www/nextcloud/occ on line 11

???

php is the command to be executed. like python, java, bash.
ooc is a script file. you can view its content with more /var/www/nextcloud/occ
db:add-missing-indices is parameter to control occ.

with ... php .../occ occ ... you try to run a php script called occ with a parameter occ. and occ doesn’t know what to do with occ as a parameter.

try:

sudo -u www-data php /var/www/nextcloud/occ --help
1 Like
root@nextcloud:~# sudo -u www-data php /var/www/nextcloud/occ --help
PHP Warning:  require_once(/var/www/nextcloud/console.php): failed to open stream: No such file or directory in /var/www/nextcloud/occ on line 11
PHP Fatal error:  require_once(): Failed opening required '/var/www/nextcloud/console.php' (include_path='.:/usr/share/php') in /var/www/nextcloud/occ on line 11
root@nextcloud:~#



root@nextcloud:/var/www/nextcloud# more /var/www/nextcloud/occ
#!/usr/bin/env php
<?php
/**
 * Copyright (c) 2013 Thomas Müller <thomas.mueller@tmit.eu>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */

//$argv = $_SERVER['argv'];
require_once __DIR__ . '/console.php';

something happend to your nextcloud installation. because console.php is missing.

it shouldn’t be a problem, because you’ll find it in the download files here Index of /server/releases .

the version you need should be in cat /var/www/nextcloud/version.php

1 Like

Hi Reiner,

Thank you very much, after copy paste console to nextcloud root the help command works

root@nextcloud:/var/www/nextcloud# sudo -u www-data php /var/www/nextcloud/occ --help
Description:
Lists commands

Usage:
list [options] [–] []

Arguments:
namespace The namespace name

Options:
–raw To output raw command list
–format=FORMAT The output format (txt, xml, json, or md) [default: “txt”]

Help:
The list command lists all commands:

php /var/www/nextcloud/occ list

You can also display the commands for a specific namespace:

php /var/www/nextcloud/occ list test

You can also output the information in other formats by using the --format option:

php /var/www/nextcloud/occ list --format=xml

It’s also possible to get raw list of commands (useful for embedding command runner):

php /var/www/nextcloud/occ list --raw

root@nextcloud:/var/www/nextcloud#

Either the occ commands works fine too

root@nextcloud:/var/www/nextcloud# sudo -u www-data php /var/www/nextcloud/occ db:add-missing-primary-keys
Check primary keys.
Adding primary key to the federated_reshares table, this can take some time…
federated_reshares table updated successfully.
Adding primary key to the systemtag_object_mapping table, this can take some time…
systemtag_object_mapping table updated successfully.
Adding primary key to the comments_read_markers table, this can take some time…
comments_read_markers table updated successfully.
Adding primary key to the collres_resources table, this can take some time…
collres_resources table updated successfully.
Adding primary key to the collres_accesscache table, this can take some time…
collres_accesscache table updated successfully.
Adding primary key to the filecache_extended table, this can take some time…
filecache_extended table updated successfully.
root@nextcloud:/var/www/nextcloud#

Thank you very much <3