Hello everybody,
I had an owncloud 9 installation on my Kubuntu 16.04 installed from repo up and running
with sqlite.
Now I want to change to nextcloud 11.0.2
I first removed the owncloud repository installation with synaptic.
Renamed my old /var/www/owncloud dir to /var/www/nextcloud and copied all the files into it.
Now I am stuck at the point that I can not open the occ file:
et@ets:/var/www/nextcloud$ sudo -u www-data php occ
Could not open input file: occ
et@ets:/var/www/nextcloud$ cat occ
#!/usr/bin/env php
<?php
/**
_ * Copyright © 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â;
et@ets:/var/www/nextcloud$ ls -la occ
-rw-r-xr-x 1 www-data www-data 283 Feb 26 20:42 occ
Any idea what I am doing wrong?
linufix
2 Likes
Nerd
June 2, 2017, 2:15pm
2
Did you manage to find a solution to this? I just migrated from Nextcloud 10 to Nextcloud 12, and am stuck at exactly the same point⊠And yes, I am executing this - like you - in the nextcloud folderâŠ
Seems to be a php-related problem (executing occ without sudo and php in front works, but throws the error that I need to execute occ as user www-data; but as www-data, I get âCould not open input file: occâ), but I canât figure out, what it isâŠ
Edit: Well, maybe not a php problem. After going back to Nextcloud 10, everything works again�!
The file permissions are looking odd. The owner âwww-dataâ has no permission to run the script because of the missing eXecution right.
Try fixing this withâŠ
sudo chmod 744 /path/to/occ
If it still doesnât work try to use full absolute path to occ (/path/to/occ).
sudo -u www-data php /path/to/occ update
Further information:
https://docs.nextcloud.com/server/11/admin_manual/configuration_server/occ_command.html
4 Likes
Nerd
June 3, 2017, 8:30am
4
I found the solution: I had executed the chown -R www-data:www-data step from within the nextcloud folder with * - this omits changing the owner for all hidden files (starting with .). Apache thus was not able to access .htaccess when occ should be run. chown -R www-data:www-data .* resolved the problem.
2 Likes
Iâm having the exact same problem but with different setup.
I upgraded from NC11 to NC12 on nginx running on Ubuntu 16.04 and Iâm running the setup in www main directory (not /nextcloud).
I verified the whole directory is owned by www-data and has write&execute rights.
root@server:/var/www# sudo -u www-data php occ upgrade
Could not open input file: occ
I have The Same problem during The Update to The latest version. My Pi stucks in the Maintance Mode.
what i have to do to fix it ?
Schmu
July 4, 2018, 10:22pm
7
Hi,
If you were supposed to solve the problem and you only have this much information:
How would attempt to solve this problem?
Please read the posts above, they provide some good ideas, about what you could try.
i have install The latest Update from Nextcloud.
My system stucks in The Maintancemode. I have try to switch it off with a command.
I have try the commands above
Edit: where (how) i find The Path to The occ file ?
Sorry fĂŒr My english, im from Germany
This doesnât help the community. Please post the solution openly so that we all can benefit.
I managed to get a solution here with Nextcloud 15 Beta. Hope this helps someone out.
First, Iâm running Ngnix so I had to get the user account to run this under (nginx).
Then I had to install the php-process package via yum. Iâm running PHP 7.2 with Nextcloud, and it wasnât installed by default.
Then I had to cd to the folder in order to run it (/var/www/nextcloud for me).
Finally I could run the command like this successfully:
sudo -u nginx php occ files:scan [username] -v
This worked just fine, after I had deleted everything from the userâs folder and then rescanned it. Now I will rsync over their data from backup, rescan again, and should have the content back.
Hope this helps.
1 Like
danjde
February 2, 2019, 3:49pm
12
find /var/www/nextcloud/ -iname *occ*
/var/www/nextcloud/public_html/occ
Then:
sudo -u www-data php /var/www/nextcloud/public_html/occ db:convert-filecache-bigint
11 Likes
yuri
March 4, 2019, 5:13am
13
This answer was very helpful to me. I was trying to enter the maintenance mode and was getting Could not open input file: occ error. My occ file is in /srv/nextcloud. Changing directory to /srv/nextcloud and re-running the same command fixes the problem.
Thanks! The âtrickâ for me to navigate to the folder and then runn occ without the folder pathâŠ
nazo
December 22, 2019, 7:07am
15
You, Sir, were very helpful!
After so many months of your response, it still worked for me for the same issue with NC 17.0.2 update.
Many thanks for your time.
mkuntze
January 19, 2020, 5:16pm
16
That was fitting the Problem! Thank you for posting it. In nextcloud 17 the path to occ is
/var/www/nextcloud/occ
Also you have to write into console
sudo -u www-data php /var/www/nextcloud/occ db:convert-filecache-bigint
1 Like
For anyone on Ubuntu 18.04 that is trying to upgrade from 16 to 17 and need to follow the Enabling MySQL 4-byte support using the instructions here:
https://docs.nextcloud.com/server/16/admin_manual/configuration_database/mysql_4byte_support.html#mariadb-10-2-or-earlier
Steps
5. Set the mysql.utf8mb4 config to true in your config.php:
$ sudo -u www-data php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
should be
$ sudo -u www-data php /var/www/nextcloud/occ config:system:set mysql.utf8mb4 --type boolean --value="true"
Convert all existing tables to the new collation by running the repair step:
$ sudo -u www-data php occ maintenance:repair
should be
$ sudo -u www-data php /var/www/nextcloud/occ maintenance:repair
One of the comments above gave me the clue to fix this.
Hi
I read all this and I was ended here after broken upgrade:
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:139
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1519): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1041): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(261): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(281): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(411): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(176): OC\AppConfig->loadConfigValues()
#7 /var/www/nextcloud/lib/private/AppConfig.php(367): OC\AppConfig->getApps()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(965): OC\AppConfig->getValues()
#9 /var/www/nextcloud/lib/private/Server.php(724): OC_App::getAppVersions()
#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC{closure}()
#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#13 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(184): OC\AppFramework\Utility\SimpleContainer->get()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#19 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#21 /var/www/nextcloud/lib/private/Server.php(1117): OC\AppFramework\Utility\SimpleContainer->get()
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC{closure}()
#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#25 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#27 /var/www/nextcloud/lib/private/Server.php(2067): OC\AppFramework\Utility\SimpleContainer->get()
#28 /var/www/nextcloud/lib/private/Files/View.php(117): OC\Server->getLockingProvider()
#29 /var/www/nextcloud/lib/private/Server.php(461): OC\Files\View->__construct()
#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC{closure}()
#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#33 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#35 /var/www/nextcloud/lib/private/Server.php(1469): OC\AppFramework\Utility\SimpleContainer->get()
#36 /var/www/nextcloud/lib/base.php(617): OC\Server->boot()
#37 /var/www/nextcloud/lib/base.php(1144): OC::init()
#38 /var/www/nextcloud/console.php(48): require_once(ââŠâ)
#39 /var/www/nextcloud/occ(11): require_once(ââŠâ)
have you any idea please?