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

During migration from sqlite to pgsql the script fails with "Numeric value out of range" #37326

Closed
gree7 opened this issue May 1, 2020 · 3 comments

Comments

@gree7
Copy link

gree7 commented May 1, 2020

Steps to reproduce

  1. Have large enough ownCloud installation with data within database in sqlite
  2. run sudo -u www-data ./occ db:convert-type --all-apps pgsql owncloud localhost owncloud

Expected behaviour

The script should finish without an error.

Actual behaviour

A error is thrown:

sudo -u www-data ./occ db:convert-type --all-apps pgsql owncloud localhost owncloud

PHP Warning: Module 'pgsql' already loaded in Unknown on line 0
ownCloud is in maintenance mode - no app have been loaded

Enter a new password:
Creating schema in new database
The following tables will not be converted:
oc_account_terms
oc_accounts
oc_addressbookchanges
oc_addressbooks
oc_calendarchanges
oc_calendarobjects
oc_calendars
oc_calendarsubscriptions
oc_cards
oc_cards_properties
oc_dav_job_status
oc_dav_properties
oc_dav_shares
oc_external_applicable
oc_external_config
oc_external_mounts
oc_external_options
oc_federated_reshares
oc_files_trash
oc_migrations
oc_notifications
oc_properties
oc_schedulingobjects
oc_share
oc_share_external
Continue with the conversion (y/n)? [n] y
oc_appconfig
174/174 [============================] 100%oc_storages
12/12 [============================] 100%oc_mounts
65/65 [============================] 100%oc_mimetypes
76/76 [============================] 100%oc_filecache
chunked query, 57 chunks
0/56754 [>---------------------------] 0%
In AbstractPostgreSQLDriver.php line 91:

An exception occurred while executing 'INSERT INTO "oc_filecache" ("fileid", "storage", "path", "path_hash", "parent", "name", "mimetype", "mimepart", "size", "encrypted", "unencrypted_size", "etag", "permissions", "checksum", "mtime", "storage_mtime") VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["20", "3", "", "d41d8cd98f00b204e9800998ecf8427e", "-1", "", "2", "1", "21507912319", "0", "0", "5ea880f666c83", "23", "", "4294967295", "1511258462"]:

SQLSTATE[22003]: Numeric value out of range: 7 ERROR: value "4294967295" is out of range for type integer

In PDOStatement.php line 107:

SQLSTATE[22003]: Numeric value out of range: 7 ERROR: value "4294967295" is out of range for type integer

In PDOStatement.php line 105:

SQLSTATE[22003]: Numeric value out of range: 7 ERROR: value "4294967295" is out of range for type integer

db:convert-type [--port PORT] [--password PASSWORD] [--clear-schema] [--all-apps] [--chunk-size CHUNK-SIZE] [--]

Server configuration

Operating system:
Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux

Web server:
nginx version: nginx/1.10.3

Database:
SQLite3 -> PostgreSQL 9.6

PHP version:
7.0

ownCloud version: (see ownCloud admin page)
10.0.10.4

Updated from an older ownCloud or fresh install:
fresh install

Where did you install ownCloud from:
ownCloud webpage

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

No errors have been found.

The content of config/config.php:

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

{
"system": {
"instanceid": "occk2gbfo7mj",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"REMOVED SENSITIVE VALUE"
],
"datadirectory": "/var/www/owncloud/data",
"overwrite.cli.url": "REMOVED SENSITIVE VALUE",
"overwriteprotocol": "https",
"dbtype": "sqlite3",
"version": "10.0.10.4",
"logtimezone": "UTC",
"installed": true,
"loglevel": 0,
"mail_domain": "REMOVED SENSITIVE VALUE",
"mail_smtpmode": "php",
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"mail_smtpport": "587",
"mail_smtpsecure": "tls",
"theme": "",
"maintenance": false
},
"apps": {
"activity": {
"signed": "true",
"installed_version": "2.4.2",
"enabled": "yes",
"types": "filesystem"
},
"backgroundjob": {
"lastjob": "12942"
},
"bookmarks": {
"signed": "true",
"installed_version": "0.10.6",
"enabled": "yes",
"types": "",
"ocsid": "168710"
},
"calendar": {
"signed": "true",
"installed_version": "1.6.4",
"enabled": "yes",
"types": ""
},
"comments": {
"installed_version": "0.3.0",
"types": "logging,dav",
"enabled": "yes"
},
"configreport": {
"installed_version": "0.1.1",
"types": "filesystem",
"enabled": "yes"
},
"contacts": {
"signed": "true",
"installed_version": "1.5.5",
"enabled": "yes",
"types": ""
},
"core": {
"installedat": "1511099890.1072",
"lastupdatedat": "1551899894",
"public_files": "files_sharing/public.php",
"public_webdav": "dav/appinfo/v1/publicwebdav.php",
"lastcron": "1588334402",
"lastupdateResult": "[]",
"backgroundjobs_mode": "cron",
"updater.secret.created": "1537951697",
"vendor": "owncloud",
"oc.integritycheck.checker": "[]"
},
"dav": {
"installed_version": "0.4.0",
"types": "filesystem",
"enabled": "yes"
},
"drawio": {
"signed": "true",
"installed_version": "0.0.8",
"enabled": "yes",
"types": ""
},
"federatedfilesharing": {
"installed_version": "0.3.1",
"types": "filesystem",
"enabled": "yes"
},
"federation": {
"installed_version": "0.1.0",
"types": "authentication",
"enabled": "yes"
},
"files": {
"installed_version": "1.5.1",
"types": "filesystem",
"enabled": "yes",
"cronjob_scan_files": "500"
},
"files_clipboard": {
"signed": "true",
"installed_version": "1.0.2",
"enabled": "yes",
"types": ""
},
"files_external": {
"installed_version": "0.7.1",
"ocsid": "166048",
"types": "filesystem",
"enabled": "yes"
},
"files_markdown": {
"installed_version": "2.2.0",
"types": "",
"enabled": "no"
},
"files_pdfviewer": {
"signed": "true",
"installed_version": "0.11.0",
"enabled": "yes",
"types": "",
"ocsid": "166049"
},
"files_sharing": {
"installed_version": "0.11.0",
"types": "filesystem",
"enabled": "yes"
},
"files_texteditor": {
"signed": "true",
"installed_version": "2.3.0",
"enabled": "yes",
"types": ""
},
"files_textviewer": {
"signed": "true",
"installed_version": "1.0.3",
"enabled": "yes",
"types": ""
},
"files_trashbin": {
"installed_version": "0.9.1",
"types": "filesystem",
"enabled": "yes"
},
"files_versions": {
"installed_version": "1.3.0",
"types": "filesystem",
"enabled": "yes"
},
"files_videoplayer": {
"installed_version": "0.9.8",
"types": "",
"enabled": "yes"
},
"firstrunwizard": {
"installed_version": "1.1",
"ocsid": "166055",
"types": "",
"enabled": "yes"
},
"gallery": {
"signed": "true",
"installed_version": "16.1.1",
"enabled": "yes",
"types": ""
},
"market": {
"installed_version": "0.4.0",
"types": "",
"enabled": "yes",
"market": "0.4.0",
"signed": "true",
"files_clipboard": "1.0.2",
"calendar": "1.6.4",
"richdocuments": "2.1.2",
"polls": "0.8.1",
"contacts": "1.5.5",
"templateeditor": "0.4.0",
"rainloop": "5.1.0",
"gallery": "16.1.1",
"files_pdfviewer": "0.11.0",
"onlyoffice": "4.1.3",
"activity": "2.4.2",
"bookmarks": "0.10.6",
"files_texteditor": "2.3.0",
"tasks": "0.9.7",
"key": null
},
"notes": {
"signed": "true",
"installed_version": "2.0.4",
"enabled": "yes",
"types": ""
},
"notifications": {
"installed_version": "0.3.5",
"types": "logging",
"enabled": "yes"
},
"onlyoffice": {
"signed": "true",
"installed_version": "4.1.3",
"enabled": "yes",
"types": "filesystem",
"skey": "1516786498702"
},
"ownpad": {
"installed_version": "0.6.2",
"ocsid": "174679",
"types": "",
"enabled": "no"
},
"passman": {
"signed": "true",
"installed_version": "2.1.4",
"enabled": "yes",
"types": ""
},
"polls": {
"signed": "true",
"installed_version": "0.8.1",
"enabled": "yes",
"types": "",
"ocsid": "174671"
},
"provisioning_api": {
"installed_version": "0.5.0",
"types": "prevent_group_restriction",
"enabled": "yes"
},
"qownnotesapi": {
"signed": "true",
"installed_version": "19.1.0",
"enabled": "yes",
"types": ""
},
"rainloop": {
"signed": "true",
"installed_version": "5.1.0",
"enabled": "no",
"types": "",
"ocsid": "165254"
},
"richdocuments": {
"signed": "true",
"installed_version": "2.1.2",
"enabled": "yes",
"types": "prevent_group_restriction",
"wopi_url": "REMOVED SENSITIVE VALUE",
"canonical_webroot": "",
"ocsid": "174727"
},
"systemtags": {
"installed_version": "0.3.0",
"types": "logging",
"enabled": "yes"
},
"tasks": {
"signed": "true",
"installed_version": "0.9.7",
"enabled": "yes",
"types": ""
},
"templateeditor": {
"installed_version": "0.4.0",
"types": "",
"enabled": "yes",
"signed": "true"
},
"updatenotification": {
"installed_version": "0.2.1",
"types": "",
"enabled": "no",
"core": "10.0.9"
}
}
}

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Enabled:

  • activity: 2.4.2
  • bookmarks: 0.10.6
  • calendar: 1.6.4
  • comments: 0.3.0
  • configreport: 0.1.1
  • contacts: 1.5.5
  • dav: 0.4.0
  • drawio: 0.0.8
  • federatedfilesharing: 0.3.1
  • federation: 0.1.0
  • files: 1.5.1
  • files_clipboard: 1.0.2
  • files_external: 0.7.1
  • files_pdfviewer: 0.11.0
  • files_sharing: 0.11.0
  • files_texteditor: 2.3.0
  • files_trashbin: 0.9.1
  • files_versions: 1.3.0
  • files_videoplayer: 0.9.8
  • firstrunwizard: 1.1
  • gallery: 16.1.1
  • market: 0.4.0
  • notes: 2.0.4
  • notifications: 0.3.5
  • onlyoffice: 4.1.3
  • passman: 2.1.4
  • polls: 0.8.1
  • provisioning_api: 0.5.0
  • qownnotesapi: 19.1.0
  • richdocuments: 2.1.2
  • systemtags: 0.3.0
  • tasks: 0.9.7
  • templateeditor: 0.4.0
    Disabled:
  • encryption
  • external
  • updatenotification
  • user_external

Are you using external storage, if yes which one: local/smb/sftp/...
No

Are you using encryption: yes/no
No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No

@gree7
Copy link
Author

gree7 commented May 1, 2020

There is similar bug report for Nextcloud: nextcloud/server#8143

@gree7
Copy link
Author

gree7 commented May 1, 2020

I'll try, thanks. Sorry, I missed that.

@gree7
Copy link
Author

gree7 commented May 5, 2020

In Owncloud 10.4.1 this particular issue. However there was another one, which I will report as another issue.

@gree7 gree7 closed this as completed May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant