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

Numeric value out of rance #1106

Closed
lorenzo93 opened this issue Oct 20, 2023 · 5 comments
Closed

Numeric value out of rance #1106

lorenzo93 opened this issue Oct 20, 2023 · 5 comments
Labels

Comments

@lorenzo93
Copy link

lorenzo93 commented Oct 20, 2023

Hi,

I've installed the music plugin some days ago (v1.9.1) and I'm getting an error while syncing.
The error log says

Numeric value out of range: 7 ERROR: value "4294967295" is out of range for type integer CONTEXT: unnamed portal parameter $2 = '...'

I was thinking it is something related to #1073 but looking at the stacktrace I found this line that looks like the record that the application is trying to insert into the database

Music\BusinessLayer\TrackBusinessLayer->addOrUpdateTrack("Si Tu No Vuelves", 4294967295, 1, 2007, 150, 906, 2548, 5859, "*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***", 314, 192000)

whole log here

If I'm not wrong that's a calculated value and does not have anything to do with the max column size of #1073, so I'm opening a new issue. If you think that's related feel free to close this one and I'll reopen that #1073.

I'm using PostreSQL as backend database.
If you need any other information do not hesitate to ask any further :)

P.S.: The file has actually that really big number as trackID in the metadata. I've managed to bypass the error manually modifying the metadata of the file. But I think that's not the way it's supposed to handle the error

@paulijar
Copy link
Collaborator

Thanks for the report. It seems that, unlike MySQL and SQLite, PostgreSQL doesn't actually have an unsigned integer type but all integers are stored as signed. Hence, the sanity check logic added for #1073 isn't sufficient for PostgreSQL: There, we limit the values to the range 0...4294967295 but we should actually limit them to the range 0...2147483647 to prevent problems also on PostgreSQL.

@paulijar paulijar added the Bug label Oct 21, 2023
paulijar added a commit that referenced this issue Oct 21, 2023
PostgreSQL doesn't have unsigned integer types, and hence, can't handle values
larger than 2147483647 in normal integer columns (they would be supported in
bigint columns if we actually needed that large values but that's not the
case here).

refs #1106
@lorenzo93
Copy link
Author

You're welcome. Always happy to help an open source project.
I don't know which policy do you use on issues, do you close them on the commit fix or on the release of a new version with the fix? I'll leave it open, but feel free to close it whenever you want :)

@paulijar
Copy link
Collaborator

I usually keep the issues open until when then fix is released.

@djvujke
Copy link

djvujke commented Nov 28, 2023

Hi,

Facing same issue running Nextcloud 27.1.0.7 AIO and Music v1.9.1.
I have more than 3000 mp3 files but scan fails after 53.

In ExceptionConverter.php line 91: An exception occurred while executing a query: SQLSTATE 22003: Numeric value out of range: 7 ERROR: value "4294967295" is out of range for type integer CONTEXT: unnamed portal parameter $2 = '...'

In Exception.php line 30: SQLSTATE 22003: Numeric value out of range: 7 ERROR: value "4294967295" is out of range for type integer CONTEXT: unnamed portal parameter $2 = '...'

In Statement.php line 101: SQLSTATE 22003: Numeric value out of range: 7 ERROR: value "4294967295" i ] s out of range for type integer CONTEXT: unnamed portal parameter $2 = '...'

Hopefully this is enough

@paulijar
Copy link
Collaborator

The fix is now released in Music v1.10.0.

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

No branches or pull requests

3 participants