Fmstrat / Fmstrat/shorten

MySQL Exception on OC 8.2.1.4

Open
#20 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
30
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Hi,

since OC upgrade on 8.2.1 the app doesn't work anylonger.

```
Exception: {
"Exception":"Doctrine\\DBAL\\Exception\\NotNullConstraintViolationException",
"Message": "An exception occurred while executing 'INSERT INTO oc_shorten (uid, shortcode, url) VALUES (?,?,?)' with params [\"xxx\", \"03JUas\", null]:SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'url' cannot be null",
"Code":0,
"Trace":"
#0 \/var\/www\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php(116): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))
#1 \/var\/www\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Statement.php(172): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'INSERT INTO oc_...', Array)
#2 \/var\/www\/owncloud\/lib\/private\/db\/statementwrapper.php(73): Doctrine\\DBAL\\Statement->execute(Array)
#3 \/var\/www\/owncloud\/apps\/shorten\/lib\/makeurl.php(38): OC_DB_StatementWrapper->execute(Array)
#4 \/var\/www\/owncloud\/apps\/shorten\/lib\/makeurl.php(58): getShortcode(NULL)
#5 \/var\/www\/owncloud\/apps\/shorten\/controller\/shortenapicontroller.php(38): generateUrl()
#6 [internal function]: OCA\\Shorten\\Controller\\ShortenApiController->makeurl()
#7 \/var\/www\/owncloud\/lib\/private\/appframework\/http\/dispatcher.php(159): call_user_func_array(Array, Array)
#8 \/var\/www\/owncloud\/lib\/private\/appframework\/http\/dispatcher.php(89): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\Shorten\\Controller\\ShortenApiController), 'makeurl')
#9 \/var\/www\/owncloud\/lib\/private\/appframework\/app.php(108): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\Shorten\\Controller\\ShortenApiController), 'makeurl')
#10 \/var\/www\/owncloud\/lib\/private\/appframework\/routing\/routeactionhandler.php(45): OC\\AppFramework\\App::main('ShortenApiContr...', 'makeurl', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)
#11 [internal function]: OC\\AppFramework\\routing\\RouteActionHandler->__invoke(Array)
#12 \/var\/www\/owncloud\/lib\/private\/route\/router.php(282): call_user_func(Object(OC\\AppFramework\\routing\\RouteActionHandler), Array)
#13 \/var\/www\/owncloud\/lib\/base.php(851): OC\\Route\\Router->match('\/apps\/shorten\/m...')
#14 \/var\/www\/owncloud\/index.php(39): OC::handleRequest()
#15 {main}",
"File":"\/var\/www\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractMySQLDriver.php",
"Line":112
}
```

Regards
calis

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at apps/shorten/lib/makeurl.php:38 and its caller in apps/shorten/controller/shortenapicontroller.php, following the shown INSERT into oc_shorten. Reproduce the /apps/shorten/makeurl request and inspect why the url parameter is null. Done means the request no longer fails with MySQL's not-null constraint exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
backend, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.