ddvk / rmfakecloud

host your own cloud for the remarkable
GNU Affero General Public License v3.0
751 stars 61 forks source link

Error Opening notepad PDF files in rmfakecloud #230

Open ncsufan8628 opened 1 year ago

ncsufan8628 commented 1 year ago

Not sure what is causing this but certain files on my remarkable are not syncing/viewable within rmfakecloud. I have this error message in my logs when I try to open one of these files. Any thoughts?

time="2023-03-21T21:46:35Z" level=error msg="json: cannot unmarshal object into Go struct field Content.pageTags of type string"

ncsufan8628 commented 1 year ago

Whoops - thought i had debugging enabled - here is the full log w/ my site and device ID blocked if that makes any difference

time="2023-03-22T00:22:12Z" level=error msg="json: cannot unmarshal object into Go struct field Content.pageTags of type string" time="2023-03-22T00:22:12Z" level=info msg="[GIN] 2023/03/22 - 00:22:12 | 500 | 3.600632ms | 108.21.220.85 | GET \"/ui/api/documents/b7952d7e-c123-4dab-b362-558e532d4a12\"" time="2023-03-22T00:22:13Z" level=info msg="Using sync 1.5" time="2023-03-22T00:22:13Z" level=info msg="setting scopes: intgr screenshare hwcmail:-1 mail:-1 sync:tortoise" time="2023-03-22T00:22:13Z" level=info msg="[GIN] 2023/03/22 - 00:22:13 | 200 | 1.335397ms | 127.0.0.1 | POST \"/token/json/2/user/new\"" time="2023-03-22T00:22:13Z" level=info msg="[auth-middleware] UserId: admin deviceId: REMARKABLEID newSync: true" time="2023-03-22T00:22:13Z" level=debug msg="blobUrl: https://MYSITENAME.com/blobstorage?blobid=root&exp=1679444833&scope=read&signature=fd46fa71a0629c8b0054557311306c54bac0a989180c2a2ab69b63565c419401&uid=admin" time="2023-03-22T00:22:13Z" level=info msg="[GIN] 2023/03/22 - 00:22:13 | 200 | 412.607µs | 127.0.0.1 | POST \"/api/v1/signed-urls/downloads\"" time="2023-03-22T00:22:13Z" level=info msg="Requested: notifications\n" time="2023-03-22T00:22:13Z" level=info msg="[GIN] 2023/03/22 - 00:22:13 | 200 | 98.138µs | 127.0.0.1 | GET \"/service/json/1/notifications?environment=production&apiVer=1\"" time="2023-03-22T00:22:13Z" level=info msg="Requestng blob: root" time="2023-03-22T00:22:13Z" level=debug msg="Fullpath: /data/users/admin/sync/root" time="2023-03-22T00:22:13Z" level=debug msg="Sending gen for root: 79" time="2023-03-22T00:22:13Z" level=info msg="[GIN] 2023/03/22 - 00:22:13 | 200 | 1.212523ms | 108.21.220.85 | GET \"/blobstorage?blobid=root&exp=1679444833&scope=read&signature=fd46fa71a0629c8b0054557311306c54bac0a989180c2a2ab69b63565c419401&uid=admin\"" time="2023-03-22T00:22:14Z" level=info msg="[auth-middleware] UserId: admin deviceId: REMARKABLEID newSync: true" time="2023-03-22T00:22:14Z" level=info msg="connecting websocket from: admin" time="2023-03-22T00:22:14Z" level=warning msg="can't upgrade websocket to ws websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header" time="2023-03-22T00:22:14Z" level=info msg="[GIN-debug] [WARNING] Headers were already written. Wanted to override status code 400 with 500" time="2023-03-22T00:22:14Z" level=info msg="[GIN] 2023/03/22 - 00:22:14 | 400 | 530.9µs | 127.0.0.1 | GET \"/notifications/ws/json/1\"" time="2023-03-22T00:22:26Z" level=info msg="Requested: notifications\n" time="2023-03-22T00:22:26Z" level=info msg="[GIN] 2023/03/22 - 00:22:26 | 200 | 368.182µs | 127.0.0.1 | GET \"/service/json/1/notifications?environment=production&apiVer=1\"" time="2023-03-22T00:22:28Z" level=info msg="[auth-middleware] UserId: admin deviceId: REMARKABLEID newSync: true" time="2023-03-22T00:22:28Z" level=info msg="connecting websocket from: admin" time="2023-03-22T00:22:28Z" level=warning msg="can't upgrade websocket to ws websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header" time="2023-03-22T00:22:28Z" level=info msg="[GIN-debug] [WARNING] Headers were already written. Wanted to override status code 400 with 500" time="2023-03-22T00:22:28Z" level=info msg="[GIN] 2023/03/22 - 00:22:28 | 400 | 392.242µs | 127.0.0.1 | GET \"/notifications/ws/json/1\""

ddvk commented 1 year ago

seems that the format of the .content file has changed. you can get the offending file as a .zip with rmapi get notename, then inspect the .content file inside

ncsufan8628 commented 1 year ago

I've gotten rmapi working, but not really sure what I am looking for in this .content file? I've tried just renaming it to .bak in hope the remarkable would regenerate it and fix the issues, but that seemed to cause me to loose pages of the notebook on the tablet.

This is the .content file that was exported.

{ "coverPageNumber": -1, "documentMetadata": { }, "dummyDocument": false, "extraMetadata": { "LastBallpointv2Color": "Black", "LastBallpointv2Size": "2", "LastCalligraphyColor": "Black", "LastCalligraphySize": "2", "LastEraseSectionColor": "Black", "LastEraseSectionSize": "2", "LastEraserColor": "Black", "LastEraserSize": "1", "LastEraserTool": "EraseSection", "LastFinelinerv2Color": "Black", "LastFinelinerv2Size": "2", "LastHighlighterv2Color": "Black", "LastHighlighterv2Size": "2", "LastMarkerv2Color": "Black", "LastMarkerv2Size": "2", "LastPaintbrushv2Color": "Black", "LastPaintbrushv2Size": "2", "LastPen": "Ballpointv2", "LastPencilv2Color": "Black", "LastPencilv2Size": "1", "LastSelectionToolColor": "Black", "LastSelectionToolSize": "2", "LastSharpPencilv2Color": "Black", "LastSharpPencilv2Size": "2", "LastTool": "Ballpointv2" }, "fileType": "notebook", "fontName": "", "formatVersion": 1, "lineHeight": -1, "margins": 125, "orientation": "portrait", "originalPageCount": -1, "pageCount": 4, "pageTags": [ { "name": "Demo", "pageId": "7ce98d31-66d5-41e2-b55f-ee8342a0ced4", "timestamp": 1679069364088 }, { "name": "Demo", "pageId": "08f31966-5ce1-494e-b774-0f99303725f6", "timestamp": 1679338219092 } ], "pages": [ "95e6d2a7-70e9-4222-a8fa-1707e5745cdb", "0976fa81-4bb7-4482-b0e4-e550b67c0a9b", "7ce98d31-66d5-41e2-b55f-ee8342a0ced4", "08f31966-5ce1-494e-b774-0f99303725f6" ], "sizeInBytes": "1119479", "tags": [ ], "textAlignment": "justify", "textScale": 1 }

ddvk commented 1 year ago

pageTags: is string, but in this file it is a list of objects, the code needs to be fixed