[Bug]: option `-n, --no-interaction` is ignored on occ db:convert-type command
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
The issue names core/Command/Db/ConvertType.php and shows the confirmation prompt still runs with --no-interaction. Read the prompt handling around the reported lines, then check the command's existing tests for database conversion options. Done means --no-interaction skips the prompt and conversion proceeds; the issue provides no test file name.
Written by the indexing model from the issue text.
Description
⚠️ This issue respects the following points: ⚠️
- This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
- This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
- I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
- I agree to follow Nextcloud's Code of Conduct.
- I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.
Bug description
Due to the length process of database convertion, I would like to run occ db:convert-type on nohup. However, the command simply quited when stdin was read.
# nohup occ db:convert-type --password='PASSWORD' --port="5432" --all-apps --no-interaction pgsql 'nc_user' postgresql nextcloud >/config/convertion-pgsql.log 2>&1 &
Nextcloud is in maintenance mode, no apps are loaded.
Commands provided by apps are unavailable.
Clearing schema in new database
Creating schema in new database
- password_policy
- memories
- files_external
- text
- external
- cloud_federation_api
- serverinfo
- user_ldap
- nextcloud_announcements
- admin_audit
- encryption
- oauth2
- notifications
- contactsinteraction
- privacy
- logreader
- recognize
- activity
- comments
- twofactor_nextcloud_notification
- app_api
- sharing
- maps
- related_resources
- webhook_listeners
- files_lock
- files_trashbin
- photos
- firstrunwizard
- user_status
- files_reminders
- viewer
- circles
- dashboard
- workflowengine
- survey_client
- files_downloadlimit
- theming
- twofactor_backupcodes
- recommendations
- files_pdfviewer
- testing
- previewgenerator
- lookup_server_connector
- sharebymail
- files_sharing
- weather_status
- systemtags
- settings
- imageconverter
- appstore
- support
- provisioning_api
- federation
- suspicious_login
- bruteforcesettings
- federatedfilesharing
- files_versions
- updatenotification
- profile
- office
- dav
- twofactor_totp
- files
The following tables will not be converted:
memories_planet_geometry
oc_ex_event_handlers
oc_ex_speech_to_text
oc_ex_speech_to_text_q
oc_ex_text_processing
oc_ex_text_processing_q
oc_ex_translation
oc_ex_translation_q
oc_facerecog_faces
oc_facerecog_images
oc_facerecog_models
oc_facerecog_persons
oc_file_metadata
Continue with the conversion (y/n)? [n]
The following command failed as well.
# nohup bash echo -e "y\n" | occ db:convert-type --password='PASSWORD' --port="5432" --all-apps --no-interaction pgsql 'nc_user' postgresql nextcloud >/config/convertion-pgsql.log 2>&1 &
I've solved the problem by following the suggestion from Converting DB Type with single command of the Help forums
Steps to reproduce
- type the following command into the terminal
nohup sudo -E -u www-data php occ db:convert-type --password='PASSWORD' --port="5432" --all-apps --no-interaction pgsql 'nc_user' postgresql nextcloud >/config/convertion-pgsql.log 2>&1 &
Expected behavior
It convert the database successfully.
Nextcloud Server version
35
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.5
Web server
Nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
Nextcloud is in maintenance mode, no apps are loaded.
Commands provided by apps are unavailable.
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"serverid": 0,
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"***REMOVED SENSITIVE VALUE***"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"version": "35.0.2.2",
"dbtype": "mysql",
"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_locale": "en_US",
"default_phone_region": "GB",
"default_timezone": "Europe\/London",
"knowledgebaseenabled": true,
"remember_login_cookie_lifetime": 2592000,
"session_lifetime": 604800,
"session_relaxed_expiry": false,
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "587",
"mail_smtpsecure": "tls",
"mail_smtpauth": true,
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"mail_sendmailmode": "smtp",
"mail_smtpauthtype": "LOGIN",
"overwritehost": "",
"overwriteprotocol": "",
"overwrite.cli.url": ***REMOVED SENSITIVE VALUE***",
"connectivity_check_domains": [
"***REMOVED SENSITIVE VALUE***"
],
"logfilemode": 416,
"loglevel": 2,
"log_rotate_size": 10485760,
"enable_previews": true,
"preview_concurrency_all": 36,
"preview_concurrency_new": 18,
"preview_max_x": 1024,
"preview_max_y": 1024,
"preview_max_filesize_image": 50,
"preview_max_memory": 256,
"preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
"jpeg_quality": 60,
"preview_max_scale_factor": 1,
"enabledPreviewProviders": [
"OC\\Preview\\Imaginary",
"OC\\Preview\\Krita",
"OC\\Preview\\MarkDown",
"OC\\Preview\\OpenDocument",
"OC\\Preview\\TXT",
"OC\\Preview\\PNG",
"OC\\Preview\\JPEG",
"OC\\Preview\\GIF",
"OC\\Preview\\BMP",
"OC\\Preview\\XBitmap",
"OC\\Preview\\WebP",
"OC\\Preview\\Movie",
"OC\\Preview\\TIFF",
"OC\\Preview\\HEIC",
"OC\\Preview\\Image"
],
"maintenance": true,
"maintenance_window_start": 2,
"memcache.local": "\\OC\\Memcache\\APCu",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 0
},
"theme": "",
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"memcache.locking": "\\OC\\Memcache\\Redis",
"debug": false,
"filelocking.enabled": true,
"upgrade.disable-web": false,
"filesystem_check_changes": 0,
"memories.exiftool": "\/config\/www\/nextcloud\/apps\/memories\/bin-ext\/exiftool-amd64-musl",
"memories.vod.path": "\/config\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
"memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
"memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
"memories.db.triggers.fcu": true,
"activity_expire_days": 731
}
}
List of activated Apps
Nextcloud is in maintenance mode, no apps are loaded.
Commands provided by apps are unavailable.
Enabled:
- activity: 8.0.0
- appstore: 2.0.0
- bruteforcesettings: 8.0.0
- circles: 35.0.0
- cloud_federation_api: 2.0.0
- comments: 2.0.0
- contactsinteraction: 2.0.0
- dashboard: 8.0.0
- dav: 2.0.0
- external: 10.0.0
- federatedfilesharing: 2.0.0
- federation: 2.0.0
- files: 3.0.0
- files_downloadlimit: 5.3.0
- files_external: 2.0.0
- files_lock: 35.0.1
- files_pdfviewer: 8.0.0
- files_reminders: 2.0.0
- files_sharing: 2.0.0
- files_trashbin: 2.0.0
- files_versions: 2.0.0
- firstrunwizard: 8.0.0
- logreader: 8.0.0
- lookup_server_connector: 2.0.0
- nextcloud_announcements: 7.0.0
- notifications: 8.0.1
- oauth2: 2.0.0
- office: 1.1.0
- password_policy: 7.0.0
- photos: 8.0.0
- privacy: 7.0.0
- profile: 2.0.0
- provisioning_api: 2.0.0
- recognize: 13.1.0
- recommendations: 8.0.0
- related_resources: 6.0.0
- serverinfo: 7.0.0
- settings: 2.0.0
- sharebymail: 2.0.0
- sharing: 1.0.4
- support: 7.0.0
- survey_client: 7.0.0
- systemtags: 2.0.0
- text: 9.0.1
- theming: 3.0.0
- twofactor_backupcodes: 2.0.0
- twofactor_totp: 17.1.0
- updatenotification: 2.0.0
- user_status: 2.0.0
- viewer: 8.0.0
- weather_status: 2.0.0
- webhook_listeners: 2.0.0
- workflowengine: 3.0.0
Disabled:
- admin_audit: 2.0.0
- app_api: 35.0.0 (installed 32.0.0)
- encryption: 3.0.1
- imageconverter: 2.2.0 (installed 2.2.0)
- maps: 1.6.0 (installed 1.6.0)
- memories: 8.0.1 (installed 8.0.1)
- previewgenerator: 5.13.0 (installed 5.13.0)
- suspicious_login: 13.0.0 (installed 10.0.0-dev.0)
- testing: 1.23.0
- twofactor_nextcloud_notification: 9.0.0
- user_ldap: 2.0.0
Nextcloud Signing status
The database is converting.
Nextcloud is in maintenance mode.
Nextcloud Logs
Additional info
The Nextcloud instance is running in a docker container made from this image: linuxserver/nextcloud:latest
The modification I have made to [nextcloud]/core/Command/Db/ConvertType.php
# diff ConvertType.php.ori ConvertType.php
--- ConvertType.php.ori
+++ ConvertType.php
@@ -188,16 +188,17 @@
$output->writeln('<comment>Please note that tables belonging to disabled (but not removed) apps</comment>');
$output->writeln('<comment>can be included by specifying the --all-apps option.</comment>');
}
+ if (!$input->getOption('no-interaction')) {
+ $continueConversion = !$input->isInteractive(); // assume yes for --no-interaction and no otherwise.
+ $question = new ConfirmationQuestion('Continue with the conversion (y/n)? [n] ', $continueConversion);
- $continueConversion = !$input->isInteractive(); // assume yes for --no-interaction and no otherwise.
- $question = new ConfirmationQuestion('Continue with the conversion (y/n)? [n] ', $continueConversion);
+ /** @var QuestionHelper $helper */
+ $helper = $this->getHelper('question');
- /** @var QuestionHelper $helper */
- $helper = $this->getHelper('question');
-
- if (!$helper->ask($input, $output, $question)) {
- return 1;
+ if (!$helper->ask($input, $output, $question)) {
+ return 1;
+ }
}
}
$intersectingTables = array_intersect($toTables, $fromTables);
$this->convertDB($fromDB, $toDB, $intersectingTables, $input, $output);
- Dominant language
- PHP
- Stars
- 37.2k
- Forks
- 5.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 656
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/server
-
1. to develop bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
0. Needs triage 35-feedback bug team: Files
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[Bug]: SnowflakeGenerator passes arguments in wrong order to ISequence, causing duplicate IDs in Nextcloud 35Possibly taken A pull request linked to this issue is open or already merged. Open0. Needs triage 35-feedback bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
nextcloud/server#65434 · 1 comment ·
Maintainers usually reply within 1 day
-
0. Needs triage 35-feedback bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
34-feedback
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
All issues in nextcloud/server
Similar issues
-
product / auth product / databases product / functions product / messaging product / storage product / vcs
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
good first issue ux
Difficulty 1/5 Under an hour Newbie friendliness 89/100
alleyinteractive/wp-curate#498 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
mollie/PrestaShop#1593 ·
Maintainers usually reply within 7 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day