Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When updating Error: Base table or view already exists: 1050 Table 'nextcloud.oc_ex_apps' already exists #506

Open
merlin1de opened this issue Feb 10, 2025 · 6 comments
Labels
question Further information is requested

Comments

@merlin1de
Copy link

Describe the bug

When updating 29.0.11 or trying to install manuelly, I get the following error:

Error: An exception occurred while executing a query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'nextcloud.oc_ex_apps' already exists

When looking via phpMyAdmin such a table does not exist.

Steps/Code to Reproduce

Update docker to 3.0.5 (latest/stable)
or on consolue with 29.0.11: php occ app:install app_api

Expected Results

It is installed and works.

Actual Results

Error: An exception occurred while executing a query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'nextcloud.oc_ex_apps' already exists

Setup configuration

nextcloud = 29.0.11

@oleksandr-nc
Copy link
Contributor

we need a little more information on how to reproduce this and where the problem is.
the error is very strange, and it is not entirely clear where to look.

It would be ideal of course to reproduce the problem on Nextcloud 30 where AppAPI is enabled by default...

@merlin1de
Copy link
Author

Thats a bit difficult. This error currently makes it impossible for me to upgrade to Nextcloud 30.
I made both approaches, with installing app_api first, or with the normal upgrade process.

@oleksandr-nc
Copy link
Contributor

Can you remove "appi_appi" and then try to update?

Maybe after removing app_api, if you are using redis or any other cache, try reset it

@merlin1de
Copy link
Author

merlin1de commented Feb 12, 2025

Restarted both containers (MariaDB and nextcloud)

www-data@5df971ff7748:~/html$ php occ app:list | grep app_api
www-data@5df971ff7748:~/html$ php occ integrity:check-app app_api
  - EXCEPTION:
    - class: Exception
    - message: App not found
www-data@5df971ff7748:~/html$ php occ app:install app_api
Error: An exception occurred while executing a query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table '`nextcloud`.`oc_ex_apps`' already exists
www-data@5df971ff7748:~/html$ php occ app:remove app_api
app_api disabled
app_api 0 removed
www-data@5df971ff7748:~/html$ php occ app:install app_api
Error: An exception occurred while executing a query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table '`nextcloud`.`oc_ex_apps`' already exists
www-data@5df971ff7748:~/html$

@joshtrichards
Copy link
Member

Update docker to 3.0.5 (latest/stable)
When looking via phpMyAdmin such a table does not exist.

Please provide your Compose file and the output of occ config:list system

www-data@5df971ff7748:~/html$ php occ app:remove app_api
app_api disabled
app_api 0 removed

app_api is a shipped app in v30. It can't be removed so the above doesn't make sense. This is what it does in my v30 test instance:


www-data@ad627ff03e60:~/html$ ./occ app:remove app_api
app_api could not be removed as it is a shipped app
www-data@ad627ff03e60:~/html$ 

@joshtrichards joshtrichards added the question Further information is requested label Feb 13, 2025
@merlin1de
Copy link
Author

No compose file, for me no suprises, was created by QNAP Container Station (Docker behind)
WIth the following vars.

APACHE_CONFDIR
/etc/apache2
APACHE_ENVVARS
/etc/apache2/envvars
GPG_KEYS
xxx
MYSQL_HOST
192.168.x.x
MYSQL_PASSWORD
xxx
MYSQL_USER
xxx
NEXTCLOUD_VERSION
29.0.11
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PHPIZE_DEPS
autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c
PHP_ASC_URL
https://www.php.net/distributions/php-8.2.20.tar.xz.asc
PHP_CFLAGS
-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PHP_CPPFLAGS
-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PHP_INI_DIR
/usr/local/etc/php
PHP_LDFLAGS
-Wl,-O1 -pie
PHP_MEMORY_LIMIT
512M
PHP_OPCACHE_MEMORY_CONSUMPTION
128
PHP_SHA256
xxx
PHP_UPLOAD_LIMIT
512M
PHP_URL
https://www.php.net/distributions/php-8.2.20.tar.xz
PHP_VERSION
8.2.20

following network
Standard (NAT)
bridge
Container Network (lxcbr0) (10.0.3.1) - 10.0.3.xx
10.0.3.xx
02:xx:0a:00:xx:xx

following pathes
/nextcloud/data
/var/www/html

www-data@5df971ff7xxx:~/html$ php occ config:list system
{
"system": {
"instanceid": "REMOVED SENSITIVE VALUE",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"cloud.xxx.xxx",
"192.168.2.xx"
],
"datadirectory": "REMOVED SENSITIVE VALUE",
"dbtype": "mysql",
"version": "29.0.11.1",
"overwrite.cli.url": "http://192.168.2.xx",
"overwriteprotocol": "https",
"dbname": "REMOVED SENSITIVE VALUE",
"dbhost": "REMOVED SENSITIVE VALUE",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"default_language": "de",
"default_locale": "de_DE",
"default_phone_region": "DE",
"memcache.local": "\OC\Memcache\APCu",
"mail_smtpmode": "smtp",
"mail_smtpsecure": "ssl",
"mail_sendmailmode": "smtp",
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_domain": "REMOVED SENSITIVE VALUE",
"mail_smtpauthtype": "LOGIN",
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"mail_smtpport": "465",
"mail_smtpauth": 1,
"mail_smtpname": "REMOVED SENSITIVE VALUE",
"mail_smtppassword": "REMOVED SENSITIVE VALUE",
"activity_expire_days": "14",
"maintenance": false,
"updater.release.channel": "stable",
"theme": "",
"loglevel": 2,
"log_type": "file",
"logfile": "/var/www/html/data/nextcloud.log",
"logdateformat": "d.m.Y H:i:s",
"maintenance_window_start": 1,
"memories.db.triggers.fcu": true,
"memories.exiftool": "/var/www/html/apps/memories/bin-ext/exiftoo l-amd64-glibc",
"memories.vod.path": "/var/www/html/apps/memories/bin-ext/go-vod- amd64",
"memories.vod.ffmpeg": "/usr/bin/ffmpeg",
"memories.vod.ffprobe": "/usr/bin/ffprobe",
"updater.secret": "REMOVED SENSITIVE VALUE",
"data-fingerprint": "xxx"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants