Nextcloud-deck: Syncronization Errors when creating a long card title

Created on 15 Aug 2020  Â·  21Comments  Â·  Source: stefan-niedermann/nextcloud-deck

Describe the bug
When I try to sync between the Android app and the server, I get lots of errors which results in no synchronization between the Mobile App and the Server.

Server log:
[PHP] Error: session_start(): A session had already been started - ignoring at /var/www/nextcloud/lib/private/Session/Internal.php#209

GET /index.php/apps/deck/api/v1.0/boards/14/stacks/55/cards/95?
from 12.12.12.12 at 2020-08-15T12:34:48+00:00

Android App Log:

App Version: 1.9.7
App Version Code: 1009007
App Flavor: play

Deck Server Version: 1.0.5

Files App Version Code: 30120190

---
snip

---

com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException: HTTP request failed with HTTP status-code: 500
    at com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:172)
    at com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:168)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$NextcloudAPI(NextcloudAPI.java:110)
    at com.nextcloud.android.sso.api.-$$Lambda$NextcloudAPI$HPzOdi9LOc_f-wA9GNnhc9LKQSM.subscribe(Unknown Source:6)
    at io.reactivex.internal.operators.observable.ObservableFromPublisher.subscribeActual(ObservableFromPublisher.java:31)
    at io.reactivex.Observable.subscribe(Observable.java:12284)
    at io.reactivex.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:32)
    at io.reactivex.Observable.subscribe(Observable.java:12284)
    at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
    at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
    at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
    at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.IllegalStateException: {"status":500,"message":"An exception occurred while executing 'INSERT INTO `oc_deck_cards`(`title`,`stack_id`,`type`,`order`,`owner`,`description`,`created_at`,`last_modified`) VALUES(?,?,?,?,?,?,?,?)' with params [\"as an organization we need to be able to work with all kinds of groups and different people we just need to be able to be flexible as hell\", 8, \"plain\", 26, \"rimez\", \"\", 1597494527, 1597494527]:\n\nSQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'title' at row 1","exception":{"\u0000Doctrine\\DBAL\\Exception\\DriverException\u0000driverException":{"errorInfo":["22001",1406,"Data too long for column 'title' at row 1"]},"\u0000*\u0000message":"An exception occurred while executing 'INSERT INTO `oc_deck_cards`(`title`,`stack_id`,`type`,`order`,`owner`,`description`,`created_at`,`last_modified`) VALUES(?,?,?,?,?,?,?,?)' with params [\"as an organization we need to be able to work with all kinds of groups and different people we just need to be able to be flexible as hell\", 8, \"plain\", 26, \"rimez\", \"\", 1597494527, 1597494527]:\n\nSQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'title' at row 1","\u0000Exception\u0000string":"","\u0000*\u0000code":0,"\u0000*\u0000file":"\/var\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractMySQLDriver.php","\u0000*\u0000line":106,"\u0000Exception\u0000trace":[{"file":"\/var\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php","line":169,"function":"convertException","class":"Doctrine\\DBAL\\Driver\\AbstractMySQLDriver","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php","line":145,"function":"wrapException","class":"Doctrine\\DBAL\\DBALException","type":"::"},{"file":"\/var\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Statement.php","line":162,"function":"driverExceptionDuringQuery","class":"Doctrine\\DBAL\\DBALException","type":"::"},{"file":"\/var\/www\/nextcloud\/lib\/public\/AppFramework\/Db\/Mapper.php","line":253,"function":"execute","class":"Doctrine\\DBAL\\Statement","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/apps\/deck\/lib\/Db\/DeckMapper.php","line":49,"function":"execute","class":"OCP\\AppFramework\\Db\\Mapper","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/lib\/public\/AppFramework\/Db\/Mapper.php","line":128,"function":"execute","class":"OCA\\Deck\\Db\\DeckMapper","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/apps\/deck\/lib\/Db\/CardMapper.php","line":66,"function":"insert","class":"OCP\\AppFramework\\Db\\Mapper","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/apps\/deck\/lib\/Service\/CardService.php","line":189,"function":"insert","class":"OCA\\Deck\\Db\\CardMapper","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/apps\/deck\/lib\/Controller\/CardApiController.php","line":83,"function":"create","class":"OCA\\Deck\\Service\\CardService","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":170,"function":"create","class":"OCA\\Deck\\Controller\\CardApiController","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func"},{"file":"\/var\/www\/nextcloud\/lib\/base.php","line":1007,"function":"match","class":"OC\\Route\\Router","type":"-\u003E"},{"file":"\/var\/www\/nextcloud\/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"\u0000Exception\u0000previous":{"errorInfo":["22001",1406,"Data too long for column 'title' at row 1"]}}}

    at com.nextcloud.android.sso.InputStreamBinder.processRequestV2(InputStreamBinder.java:429)
    at com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestAndBodyStreamV2(InputStreamBinder.java:125)
    at com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestV2(InputStreamBinder.java:108)
    at com.nextcloud.android.sso.aidl.IInputStreamService$Stub.onTransact(IInputStreamService.java:134)
    at android.os.Binder.execTransact(Binder.java:731)


UPDATE:
I have uninstalled the Playstore version for now and installed the latest version on F-Droid. I am now able to sync but I am still getting spammed with the server errors.

All 21 comments

as an organization we need to be able to work with all kinds of groups and different people we just need to be able to be flexible as hell

This title seems to be too long for the server, the message states:

1406 Data too long for column 'title' at row

Regarding this:

UPDATE:
I have uninstalled the Playstore version for now and installed the latest version on F-Droid. I am now able to sync but I am still getting spammed with the server errors.

Doesn't really matter, if the App is from F-Droid or Play Store. Create the same title in the F-Droid version, you'll get the same error. We can't do anything about this, this a limitation of the server. Deleting the AppData would have been enough, too. The only thing we _can_ do, is inform you what actually went wrong and fail gracefully...

Is there anything we can do for you to resolve your current issue, or would you say you solved the issue yourself (besides the app crash you don't experience anymore)?

@stefan-niedermann is this worth a Hint? Maybe we need a global handling for stuff like this...

So this might be related to this server issue: https://github.com/nextcloud/deck/issues/1923

This title seems to be too long for the server, the message states:

Shouldn't the application or server not allow me to save if the text is too long?

Is there anything we can do for you to resolve your current issue, or would you say you solved the issue yourself (besides the app crash you don't experience anymore)?

I'm still getting spammed with the server errors every time I sync now.

Shouldn't the application or server not allow me to save if the text is too long?

Good question tho.... @stefan-niedermann??

I'm still getting spammed with the server errors every time I sync now.

Oh. Please post the error messages here, we'll have a look!

Oh. Please post the error messages here, we'll have a look!

No Problem... it's just the same message as above...

[PHP] Error: session_start(): A session had already been started - ignoring at /var/www/nextcloud/lib/private/Session/Internal.php#209

GET /index.php/apps/deck/api/v1.0/boards/3/stacks/10/cards/315?
from SNIP at 2020-08-15T15:04:13+00:00

[PHP] Error: session_start(): A session had already been started - ignoring at /var/www/nextcloud/lib/private/Session/Internal.php#209

GET /index.php/apps/deck/api/v1.0/boards/3/stacks/10/cards/226?
from SNIP at 2020-08-15T15:04:12+00:00

[PHP] Error: session_start(): A session had already been started - ignoring at /var/www/nextcloud/lib/private/Session/Internal.php#209

But... this won't come up to the android app, right? To make this clear, we know the server app developer, @juliushaertl is a fellow friend of ours, he is working at Nextcloud, but we do this app in our spare time, not paid by Nextcloud, and don't really have an insight, how all of this works internally like he does. The code is open source, but my PHP-skills are very limited...

If the issue is not breaking the app itself, I'd suggest opening an issue in the repository of the original web-app here: https://github.com/nextcloud/deck/issues

If you still encounter the "title is too long" error, I'd suggest deleting this card and trying to make the title shorter. For now, I'm sorry, I can't do anything about this limitation, other than summoning @juliushaertl to explain the issue to us. Would you mind, @juliushaertl?

[PHP] Error: session_start(): A session had already been started - ignoring at /var/www/nextcloud/lib/private/Session/Internal.php#209

But... this won't come up to the android app, right? To make this clear, we know the server app developer, @juliushaertl is a fellow friend of ours, he is working at Nextcloud, but we do this app in our spare time, not paid by Nextcloud, and don't really have an insight, how all of this works internally like he does. The code is open source, but my PHP-skills are very limited...

Yeah right, it's the Web App that's spamming the NC log. Not the mobile app. Sorry for any confusion.

If the issue is not breaking the app itself, I'd suggest opening an issue in the repository of the original web-app here: https://github.com/nextcloud/deck/issues

Thanks, I'll follow up on this.

If you still encounter the "title is too long" error, I'd suggest deleting this card and trying to make the title shorter. For now, I'm sorry, I can't do anything about this limitation, other than summoning @juliushaertl to explain the issue to us. Would you mind, @juliushaertl?

Thanks for your help. It's really appreciated.

Shouldn't the application or server not allow me to save if the text is too long?

Good question tho.... @stefan-niedermann??

Back on this point, as you can see, the web app does not allow the creation of a title with too many characters.
It would be great if the mobile app did the same.

http://pix.toile-libre.org/upload/original/1597681470.png

EDIT: Also changed the title of the bug to make it more clear what we're talking about - the other errors messages I spoke about will be fixed (see linked issue).

We limit the length of the title depending on the server version - because an older version of the server did only allow 100 characters while newer versions allow longer titles. I currently suspect either the server version to not be detected correctly or that your server did not correctly migrate the server database when you updated your server app from an old version. This will need more investigation.

We limit the length of the title depending on the server version - because an older version of the server did only allow 100 characters while newer versions allow longer titles. I currently suspect either the server version to not be detected correctly _or_ that your server did not correctly migrate the server database when you updated your server app from an old version. This will need more investigation.

Could you possibly provide some pointers on what I can look into? As far as I am aware, I have correctly migrated the server database after upgrading. Is there an OCC command to check if it is? If I go under settings (security & set-up warnings), there are no warnings at all.

I also can only ask server app develiper @juliushaertl - it looks like you are running the latest server app version 1.0.5.

Since version 1.0.0 of the server app, the title is allowed to be 255 characters long - the Android app allows therefore 255 characters for the title - you have entered 138 characters (should be fine).

@juliushaertl is there a way to find out

  • what the limitation of the title column in this instance is and
  • why the migration didn't worked properly and updated the limitation of the title column to 255 characters when he upgraded to version 1.0.0?

@aproposnix maybe as a workaround you can try to identify cards with a title longer than 100 characters and shorten the title to "fix" the sync errors temporarily?

@stefan-niedermann

The workaround fixes the problem with syncing the card back to the server from the Android app. If I understand correctly, the errors will go away with a future release - see https://github.com/nextcloud/server/issues/20490

The workaround fixes the problem with syncing the card back to the server from the Android app.

Glad to hear!

However i am not sure whether the linked issue really solves the problem and i'd like to wait for @juliushaertl statement befoee closing this issue.

Besides this topic: Any other issues you are facing with the app?

@stefan-niedermann

According to @juliushaertl

This is actually not a deck issue, see nextcloud/server#20490 for details. A fix has been merged for Nextcloud 20 and the upcoming 19 maintenance release.

Other than the app allowing the long title, I've no other issues with this.

Thanks a lot for working on these apps. I'm using both your Deck app as well as the Notes app every day. It's all very important to my workflow.

what the limitation of the title column in this instance is and

Running show create table oc_deck_cards should give you the database schema of the cards table that indicates the length of the title column

why the migration didn't worked properly and updated the limitation of the title column to 255 characters when he upgraded to version 1.0.0?

Hm, depending on the output of the first, could you maybe also post the output of select * from oc_migrations where app='deck';

Other than the app allowing the long title, I've no other issues with this.

Glad to hear that.

Thanks a lot for working on these apps. I'm using both your Deck app as well as the Notes app every day.

According to your sarcastic comment this is hard to believe.

If you expect support and help next time, you should consider to directly ask instead of putting a 2★ rating at the Play Store for a single issue which ultimately is caused by your broken instance.

You did not even update your rating. For an open source project which you "use every day" this is the hardest possible damage a user can do to us, as just throwing in such a rating does neither help other users with the same issue, us nor you - if i wouldn't have asked you to provide more information then how should we have been able to find the root cause?

This is extremely frustrating and demotivating for us.

Trying to help you within minutes in our free time deserves more than a "i had to use the app (hooray)". No. You don't have to use it. Really.

Other than the app allowing the long title, I've no other issues with this.

Glad to hear that.

Thanks a lot for working on these apps. I'm using both your Deck app as well as the Notes app every day.

According to your sarcastic comment this is hard to believe.

If you expect support and help next time, you should consider to directly ask instead of putting a 2★ rating at the Play Store for a single issue which ultimately is caused by _your_ broken instance.

You did not even update your rating. For an open source project which you "use every day" this is the hardest possible damage a user can do to us, as just throwing in such a rating does neither help other users with the same issue, us nor you - if i wouldn't have asked you to provide more information then how should we have been able to find the root cause?

This is extremely frustrating and demotivating for us.

Trying to help you within _minutes_ in our free time deserves more than a "i had to use the app (hooray)". No. You don't have to use it. Really.

Wow. I'm sorry if you took my comment as sarcasm. It really wasn't meant to be.. I'm happy to have the Android app as a backup to the desktop. Seriously, all apologies for offending.

Seems like we have a little misunderstanding here. For me, I didn't get the comment as sarcasm, so I didn't take anything personal here. No worries @aproposnix, you provided some very useful hints for fixing a bunch of errors.

On the other hand I don't see beta-user ratings in play store, but if you like our work as much as you state, I'd like to know what we did wrong to get a two-star-rating? No need to answer that, if you really feel like this, its a pitty, but fine too.

Seems like we have a little misunderstanding here. For me, I didn't get the comment as sarcasm, so I didn't take anything personal here. No worries @aproposnix, you provided some very useful hints for fixing a bunch of errors.

On the other hand I don't see beta-user ratings in play store, but if you like our work as much as you state, I'd like to know what we did wrong to get a two-star-rating? No need to answer that, if you really feel like this, its a pitty, but fine too.

Yeah, I've updated the beta rating already. I completely just forgot to do it to be honest. I try to limit my interaction with Google play.

Thanks buddy, really appreciated! I think the rating was the point leading to the misunderstandings here, I've had forgotten to update it too, I guess 😅

And thanks for not taking it personal and your mature reaction here.

For any further issues - we're here.

Wow. I'm sorry if you took my comment as sarcasm. It really wasn't meant to be.. I'm happy to have the Android app as a backup to the desktop. Seriously, all apologies for offending.

Apologies. Had a bad day, sorry for my misinterpretation, i overreacted. 😕

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cddf picture cddf  Â·  4Comments

cappuMUC picture cappuMUC  Â·  3Comments

treuss picture treuss  Â·  3Comments

ilippert picture ilippert  Â·  7Comments

stefan-niedermann picture stefan-niedermann  Â·  7Comments