server
server copied to clipboard
"trim(): Passing null to parameter #1 ($string) of type string is deprecated at /usr/src/nextcloud/lib/private/DB/PostgreSqlMigrator.php#45
⚠️ This issue respects the following points: ⚠️
- [X] This is a bug, not a question or a configuration/webserver/proxy issue.
- [X] This issue is not already reported on Github (I've searched it).
- [X] I agree to follow Nextcloud's Code of Conduct.
What went wrong, what did you observe?
When updating app
I got the following errors:
{
"reqId": "0q6c6lObd2hnEZFyLb7e",
"level": 1,
"time": "2023-06-15T10:44:30+00:00",
"remoteAddr": "",
"user": "--",
"app": "polls",
"method": "",
"url": "--",
"message": "Polls - Migrated type of polls_preferences['timestamp'] from integer to bigint",
"userAgent": "--",
"version": "25.0.7.1",
"data": {
"app": "polls"
}
}
{
"reqId": "0q6c6lObd2hnEZFyLb7e",
"level": 0,
"time": "2023-06-15T10:44:33+00:00",
"remoteAddr": "",
"user": "--",
"app": "PHP",
"method": "",
"url": "--",
"message": "trim(): Passing null to parameter nextcloud/polls#1 ($string) of type string is deprecated at /usr/src/nextcloud/lib/private/DB/PostgreSqlMigrator.php#45",
"userAgent": "--",
"version": "25.0.7.1",
"exception": {
"Exception": "Error",
"Message": "trim(): Passing null to parameter nextcloud/polls#1 ($string) of type string is deprecated at /usr/src/nextcloud/lib/private/DB/PostgreSqlMigrator.php#45",
"Code": 0,
"Trace": [
{
"function": "onError",
"class": "OC\\Log\\ErrorHandler",
"type": "::",
"args": [
8192,
"trim(): Passing null to parameter nextcloud/polls#1 ($string) of type string is deprecated",
"/usr/src/nextcloud/lib/private/DB/PostgreSqlMigrator.php",
45
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/PostgreSqlMigrator.php",
"line": 45,
"function": "trim",
"args": [
null,
"()"
]
},
{
"function": "OC\\DB\\{closure}",
"class": "OC\\DB\\PostgreSqlMigrator",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/PostgreSqlMigrator.php",
"line": 49,
"function": "array_filter",
"args": [
[
"type",
"*** sensitive parameters replaced ***"
],
[
"Closure"
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/Migrator.php",
"line": 153,
"function": "getDiff",
"class": "OC\\DB\\PostgreSqlMigrator",
"type": "->",
"args": [
[
"Doctrine\\DBAL\\Schema\\Schema"
],
[
"OC\\DB\\Connection"
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/Migrator.php",
"line": 69,
"function": "applySchema",
"class": "OC\\DB\\Migrator",
"type": "->",
"args": [
[
"Doctrine\\DBAL\\Schema\\Schema"
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/Connection.php",
"line": 582,
"function": "migrate",
"class": "OC\\DB\\Migrator",
"type": "->",
"args": [
[
"Doctrine\\DBAL\\Schema\\Schema"
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/ConnectionAdapter.php",
"line": 237,
"function": "migrateToSchema",
"class": "OC\\DB\\Connection",
"type": "->",
"args": [
[
"Doctrine\\DBAL\\Schema\\Schema"
]
]
},
{
"file": "/usr/src/nextcloud/apps/polls/lib/Db/TableManager.php",
"line": 61,
"function": "migrateToSchema",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->",
"args": [
[
"Doctrine\\DBAL\\Schema\\Schema"
]
]
},
{
"file": "/usr/src/nextcloud/apps/polls/lib/Migration/Version050005Date20230506203301.php",
"line": 61,
"function": "migrate",
"class": "OCA\\Polls\\Db\\TableManager",
"type": "->",
"args": []
},
{
"file": "/usr/src/nextcloud/lib/private/DB/MigrationService.php",
"line": 523,
"function": "changeSchema",
"class": "OCA\\Polls\\Migration\\Version050005Date20230506203301",
"type": "->",
"args": [
[
"OC\\Migration\\SimpleOutput"
],
[
"Closure"
],
[
""
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/MigrationService.php",
"line": 416,
"function": "executeStep",
"class": "OC\\DB\\MigrationService",
"type": "->",
"args": [
"050005Date20230506203301",
false
]
},
{
"file": "/usr/src/nextcloud/lib/private/legacy/OC_App.php",
"line": 1008,
"function": "migrate",
"class": "OC\\DB\\MigrationService",
"type": "->",
"args": []
},
{
"file": "/usr/src/nextcloud/lib/private/Updater.php",
"line": 361,
"function": "updateApp",
"class": "OC_App",
"type": "::",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/usr/src/nextcloud/lib/private/Updater.php",
"line": 273,
"function": "doAppUpgrade",
"class": "OC\\Updater",
"type": "->",
"args": []
},
{
"file": "/usr/src/nextcloud/lib/private/Updater.php",
"line": 141,
"function": "doUpgrade",
"class": "OC\\Updater",
"type": "->",
"args": [
"25.0.7.1",
"25.0.7.1"
]
},
{
"file": "/usr/src/nextcloud/core/Command/Upgrade.php",
"line": 225,
"function": "upgrade",
"class": "OC\\Updater",
"type": "->",
"args": []
},
{
"file": "/usr/src/nextcloud/3rdparty/symfony/console/Command/Command.php",
"line": 255,
"function": "execute",
"class": "OC\\Core\\Command\\Upgrade",
"type": "->",
"args": [
[
"Symfony\\Component\\Console\\Input\\ArgvInput"
],
[
"Symfony\\Component\\Console\\Output\\ConsoleOutput"
]
]
},
{
"file": "/usr/src/nextcloud/3rdparty/symfony/console/Application.php",
"line": 1009,
"function": "run",
"class": "Symfony\\Component\\Console\\Command\\Command",
"type": "->",
"args": [
[
"Symfony\\Component\\Console\\Input\\ArgvInput"
],
[
"Symfony\\Component\\Console\\Output\\ConsoleOutput"
]
]
},
{
"file": "/usr/src/nextcloud/3rdparty/symfony/console/Application.php",
"line": 273,
"function": "doRunCommand",
"class": "Symfony\\Component\\Console\\Application",
"type": "->",
"args": [
[
"OC\\Core\\Command\\Upgrade"
],
[
"Symfony\\Component\\Console\\Input\\ArgvInput"
],
[
"Symfony\\Component\\Console\\Output\\ConsoleOutput"
]
]
},
{
"file": "/usr/src/nextcloud/3rdparty/symfony/console/Application.php",
"line": 149,
"function": "doRun",
"class": "Symfony\\Component\\Console\\Application",
"type": "->",
"args": [
[
"Symfony\\Component\\Console\\Input\\ArgvInput"
],
[
"Symfony\\Component\\Console\\Output\\ConsoleOutput"
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/Console/Application.php",
"line": 214,
"function": "run",
"class": "Symfony\\Component\\Console\\Application",
"type": "->",
"args": [
[
"Symfony\\Component\\Console\\Input\\ArgvInput"
],
[
"Symfony\\Component\\Console\\Output\\ConsoleOutput"
]
]
},
{
"file": "/usr/src/nextcloud/console.php",
"line": 100,
"function": "run",
"class": "OC\\Console\\Application",
"type": "->",
"args": []
},
{
"file": "/usr/src/nextcloud/occ",
"line": 11,
"args": [
"/usr/src/nextcloud/console.php"
],
"function": "require_once"
}
],
"File": "/usr/src/nextcloud/lib/private/Log/ErrorHandler.php",
"Line": 92,
"CustomMessage": "--"
}
}
{
"reqId": "0q6c6lObd2hnEZFyLb7e",
"level": 0,
"time": "2023-06-15T10:44:33+00:00",
"remoteAddr": "",
"user": "--",
"app": "PHP",
"method": "",
"url": "--",
"message": "trim(): Passing null to parameter nextcloud/polls#1 ($string) of type string is deprecated at /usr/src/nextcloud/lib/private/DB/PostgreSqlMigrator.php#45",
"userAgent": "--",
"version": "25.0.7.1",
"exception": {
"Exception": "Error",
"Message": "trim(): Passing null to parameter nextcloud/polls#1 ($string) of type string is deprecated at /usr/src/nextcloud/lib/private/DB/PostgreSqlMigrator.php#45",
"Code": 0,
"Trace": [
{
"function": "onError",
"class": "OC\\Log\\ErrorHandler",
"type": "::",
"args": [
8192,
"trim(): Passing null to parameter nextcloud/polls#1 ($string) of type string is deprecated",
"/usr/src/nextcloud/lib/private/DB/PostgreSqlMigrator.php",
45
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/PostgreSqlMigrator.php",
"line": 45,
"function": "trim",
"args": [
null,
"()"
]
},
{
"function": "OC\\DB\\{closure}",
"class": "OC\\DB\\PostgreSqlMigrator",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/PostgreSqlMigrator.php",
"line": 49,
"function": "array_filter",
"args": [
[
"notnull",
"*** sensitive parameters replaced ***"
],
[
"Closure"
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/Migrator.php",
"line": 153,
"function": "getDiff",
"class": "OC\\DB\\PostgreSqlMigrator",
"type": "->",
"args": [
[
"Doctrine\\DBAL\\Schema\\Schema"
],
[
"OC\\DB\\Connection"
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/Migrator.php",
"line": 69,
"function": "applySchema",
"class": "OC\\DB\\Migrator",
"type": "->",
"args": [
[
"Doctrine\\DBAL\\Schema\\Schema"
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/Connection.php",
"line": 582,
"function": "migrate",
"class": "OC\\DB\\Migrator",
"type": "->",
"args": [
[
"Doctrine\\DBAL\\Schema\\Schema"
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/ConnectionAdapter.php",
"line": 237,
"function": "migrateToSchema",
"class": "OC\\DB\\Connection",
"type": "->",
"args": [
[
"Doctrine\\DBAL\\Schema\\Schema"
]
]
},
{
"file": "/usr/src/nextcloud/apps/polls/lib/Db/TableManager.php",
"line": 61,
"function": "migrateToSchema",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->",
"args": [
[
"Doctrine\\DBAL\\Schema\\Schema"
]
]
},
{
"file": "/usr/src/nextcloud/apps/polls/lib/Migration/Version050005Date20230506203301.php",
"line": 61,
"function": "migrate",
"class": "OCA\\Polls\\Db\\TableManager",
"type": "->",
"args": []
},
{
"file": "/usr/src/nextcloud/lib/private/DB/MigrationService.php",
"line": 523,
"function": "changeSchema",
"class": "OCA\\Polls\\Migration\\Version050005Date20230506203301",
"type": "->",
"args": [
[
"OC\\Migration\\SimpleOutput"
],
[
"Closure"
],
[
""
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/DB/MigrationService.php",
"line": 416,
"function": "executeStep",
"class": "OC\\DB\\MigrationService",
"type": "->",
"args": [
"050005Date20230506203301",
false
]
},
{
"file": "/usr/src/nextcloud/lib/private/legacy/OC_App.php",
"line": 1008,
"function": "migrate",
"class": "OC\\DB\\MigrationService",
"type": "->",
"args": []
},
{
"file": "/usr/src/nextcloud/lib/private/Updater.php",
"line": 361,
"function": "updateApp",
"class": "OC_App",
"type": "::",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/usr/src/nextcloud/lib/private/Updater.php",
"line": 273,
"function": "doAppUpgrade",
"class": "OC\\Updater",
"type": "->",
"args": []
},
{
"file": "/usr/src/nextcloud/lib/private/Updater.php",
"line": 141,
"function": "doUpgrade",
"class": "OC\\Updater",
"type": "->",
"args": [
"25.0.7.1",
"25.0.7.1"
]
},
{
"file": "/usr/src/nextcloud/core/Command/Upgrade.php",
"line": 225,
"function": "upgrade",
"class": "OC\\Updater",
"type": "->",
"args": []
},
{
"file": "/usr/src/nextcloud/3rdparty/symfony/console/Command/Command.php",
"line": 255,
"function": "execute",
"class": "OC\\Core\\Command\\Upgrade",
"type": "->",
"args": [
[
"Symfony\\Component\\Console\\Input\\ArgvInput"
],
[
"Symfony\\Component\\Console\\Output\\ConsoleOutput"
]
]
},
{
"file": "/usr/src/nextcloud/3rdparty/symfony/console/Application.php",
"line": 1009,
"function": "run",
"class": "Symfony\\Component\\Console\\Command\\Command",
"type": "->",
"args": [
[
"Symfony\\Component\\Console\\Input\\ArgvInput"
],
[
"Symfony\\Component\\Console\\Output\\ConsoleOutput"
]
]
},
{
"file": "/usr/src/nextcloud/3rdparty/symfony/console/Application.php",
"line": 273,
"function": "doRunCommand",
"class": "Symfony\\Component\\Console\\Application",
"type": "->",
"args": [
[
"OC\\Core\\Command\\Upgrade"
],
[
"Symfony\\Component\\Console\\Input\\ArgvInput"
],
[
"Symfony\\Component\\Console\\Output\\ConsoleOutput"
]
]
},
{
"file": "/usr/src/nextcloud/3rdparty/symfony/console/Application.php",
"line": 149,
"function": "doRun",
"class": "Symfony\\Component\\Console\\Application",
"type": "->",
"args": [
[
"Symfony\\Component\\Console\\Input\\ArgvInput"
],
[
"Symfony\\Component\\Console\\Output\\ConsoleOutput"
]
]
},
{
"file": "/usr/src/nextcloud/lib/private/Console/Application.php",
"line": 214,
"function": "run",
"class": "Symfony\\Component\\Console\\Application",
"type": "->",
"args": [
[
"Symfony\\Component\\Console\\Input\\ArgvInput"
],
[
"Symfony\\Component\\Console\\Output\\ConsoleOutput"
]
]
},
{
"file": "/usr/src/nextcloud/console.php",
"line": 100,
"function": "run",
"class": "OC\\Console\\Application",
"type": "->",
"args": []
},
{
"file": "/usr/src/nextcloud/occ",
"line": 11,
"args": [
"/usr/src/nextcloud/console.php"
],
"function": "require_once"
}
],
"File": "/usr/src/nextcloud/lib/private/Log/ErrorHandler.php",
"Line": 92,
"CustomMessage": "--"
}
}
[...]
Installation method
Installed/updated via extracting downloaded package to the apps folder
Installation type
Updated from a much older version (more than one major version) - (from 3 to 5)
Affected polls version
5.0.5
NC version
Nextcloud 25 (Nextcloud Hub 3)
PHP engine version
PHP 8.1
Database engine
PostgreSQL
To me this looks like an error in https://github.com/nextcloud/server/blob/81bb3362b24a621fb399877739e7bff35ec13eb7/lib/private/DB/PostgreSqlMigrator.php#L45
@nickvergessen @ChristophWurst
Seems as
$fromDefault = trim((string) $fromDefault, "()");
could avoid the deprecation warning.
sounds good
Can you send a PR with it?