Open janvlug opened 1 year ago
This error also happens when trying to upgrade from 25.0.9 to 25.0.10:
[ nc-update-nextcloud ] (Tue Aug 22 09:33:53 BST 2023) Current Nextcloud version 25.0.9.2 Available Nextcloud version 25.0.10 ERROR 1146 (42S02) at line 1: Table 'nextcloud.oc_jobs' doesn't exist
There is a 'jobs' table in my nextcloud database, but no 'oc_jobs' database:
MariaDB [nextcloud]> show tables like 'jobs'; +----------------------------+ | Tables_in_nextcloud (jobs) | +----------------------------+ | jobs | +----------------------------+ 1 row in set (0.002 sec)
I'm pretty sure that this is the problematic line:
mysql nextcloud <<<"UPDATE oc_jobs SET reserved_at=0;"
in the file: in /usr/local/bin/ncp-update-nc
I tried changing the line with the oc_
prefix removed, but now the update failed on downloading:
But maybe this is a totally independent issue.
Edit: I just retried, and then the upgrade worked fine.
I ran again into this issue. In the /usr/local/bin/ncp-update-nc
script is this fragment:
# make sure that cron.php is not running and there are no pending jobs
# https://github.com/nextcloud/server/issues/10949
pgrep -cf cron.php &>/dev/null && { pkill -f cron.php; sleep 3; }
pgrep -cf cron.php &>/dev/null && { echo "cron.php running. Abort"; exit 1; }
mysql nextcloud <<<"UPDATE oc_jobs SET reserved_at=0;"
The issue with my Nextcloudpi installation is that it is a migration from a previous installation. My installation does not use the oc_
prefix in the database, so this line fails:
mysql nextcloud <<<"UPDATE oc_jobs SET reserved_at=0;"
Note however the reference to the closed bug 10949
[WORKAROUND] NC14 RC2: occ upgrade hangs on running cronjob it states in the above fragment of the script.
One of the comments in bug 10949
states:
"We removed this via https://github.com/nextcloud/server/pull/12188"
That merge requests seems to fix bug 9992
: Cronjob blocking update (forever)
Is my interpretation correct that the part of the script that I quoted above can therefore be removed? If that is indeed the case, removing that part would also fix this issue.
Another option to solve this issue would be to get the dbtableprefix
from the config file: /var/www/nextcloud/config/config.php
, and use that in the line:
mysql nextcloud <<<"UPDATE oc_jobs SET reserved_at=0;"
I would have to figure out how to get the value of a php config file in a /bin/bash
script.
This is a command to get the value of dbtableprefix
in a script:
php -r 'include("/var/www/nextcloud/config/config.php"); print ( $CONFIG['"'dbtableprefix'"'] );'
I created a pull request to solve the database prefix. But maybe setting the whole SQL command that I improved is not necessary any more, as described in: https://github.com/nextcloud/nextcloudpi/issues/1818#issuecomment-1962895946.
@janvlug Thank you for the PR! I adjusted it a bit, so that the dynamically detected DB prefix is used everywhere and not just in ncp-update-nc. It's now in devel and being tested
I'm getting this error with 1.54.3.
I have migrated an old database to nextcloudpi. The old database had no prefixes in the database tables, so I set in the config file dbtableprefix to ''.
But when trying to upgrade nextcloud, I get this:
table nextcloud.oc_jobs doesn't exist
System information