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