CarnetApp / CarnetNextcloud

GNU Affero General Public License v3.0
157 stars 29 forks source link

Can't save and load on 0.13.2 #40

Open Bables55 opened 5 years ago

Bables55 commented 5 years ago

Describe the bug I can create new empty notes. After that I got an error when I entered a character and it was not saved. Once I return to the list, the memo is displayed only for the date. I am loading it as soon as I try to open it. Even if I try to change the title, I will not be registered. I can open the memo that I was creating in the past.

Error

[index] Error: PhpZip\Exception\ZipException: Invalid zip file. at <<closure>>

 0. /NEXTCLOUD-DIR/apps/carnet/vendor/nelexa/zip/src/PhpZip/Stream/ZipInputStream.php line 75
    checkZipFileSignature()
 1. /NEXTCLOUD-DIR/apps/carnet/vendor/nelexa/zip/src/PhpZip/ZipFile.php line 157
    readZip()
 2. /NEXTCLOUD-DIR/apps/carnet/vendor/nelexa/zip/src/PhpZip/ZipFile.php line 106
    openFromStream(null)
 3. /NEXTCLOUD-DIR/apps/carnet/lib/Controller/NoteController.php line 726
    openFile("/tmp/5c8212269435e.zipa6KIm9")
 4. /NEXTCLOUD-DIR/lib/private/AppFramework/Http/Dispatcher.php line 166
    openNote()
 5. /NEXTCLOUD-DIR/lib/private/AppFramework/Http/Dispatcher.php line 99
    executeController(OCA\Carnet\Contr ... }}, "openNote")
 6. /NEXTCLOUD-DIR/lib/private/AppFramework/App.php line 118
    dispatch(OCA\Carnet\Contr ... }}, "openNote")
 7. /NEXTCLOUD-DIR/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    main("OCA\\Carnet\\Controller\\NoteController", "openNote", OC\AppFramework\ ... {}, {_route: "carnet.note.openNote"})
 8. <<closure>>
    __invoke({_route: "carnet.note.openNote"})
 9. /NEXTCLOUD-DIR/lib/private/Route/Router.php line 297
    call_user_func(OC\AppFramework\ ... {}, {_route: "carnet.note.openNote"})
10. /NEXTCLOUD-DIR/lib/base.php line 987
    match("/apps/carnet/note/open")
11. /NEXTCLOUD-DIR/index.php line 42
    handleRequest()

GET /index.php/apps/carnet/note/open?path=TITLE.sqd

To Reproduce Open and edit

Expected behavior To be saved

Desktop (please complete the following information):

Smartphone (please complete the following information):

PhieF commented 5 years ago

Hi,

I've just pushed an emergency update to the nextcloud store, v0.13.3, tell me if this fixes it

thanks for your report

Bables55 commented 5 years ago

I update 0.13.4. Saving is now possible, but a new error has occurred. When the user enters edit mode and enters characters, the following error occurs frequently. It does not seem to occur with title change in the main display.

[PHP] Error: fclose(): supplied resource is not a valid stream resource at /MY-NEXTCLOUD/apps/carnet/lib/Controller/NoteController.php#669

POST /index.php/apps/carnet/note/saveText
Bables55 commented 5 years ago

I updated 0.13.5 now. This also happens.

[PHP] Error: fclose(): supplied resource is not a valid stream resource at /MY-NEXTCLOUD/apps/carnet/lib/Controller/NoteController.php#673

POST /index.php/apps/carnet/note/saveText
Bables55 commented 5 years ago

Then I went back to 0.12.2. However, the error of the previous occurrence came to occur. Last time I updated to 0.13.2, then back to 0.12.2. There was no error at that time. An error occurred when updating to 0.13.4 today and 0.13.5 today. Even if I return to 0.12.2, the same error occurred.

Bables55 commented 5 years ago

I updated 0.13.7 today. The error with NoteController.php has not been resolved. Or did I have a different problem? For example, a broken DB etc.

PhieF commented 5 years ago

Really weird... Could you edit this file nextcloud/apps/carnet/lib/Controller/NoteController.php

go to line 685

remove the line

           fclose($tmph);

tell me if writing note / reopening it works

Bables55 commented 5 years ago

I deleted the line(fclose($tmph);), but the same error.

After changing it, I disabled the app and enabled it again.

PhieF commented 5 years ago

eerr in the same line ?

Bables55 commented 5 years ago

Sorry, I failed to upload. I confirmed the upload completion and verified the behavior. Now there are no errors in the Nextcloud log. carnet 0.13.7.

PhieF commented 5 years ago

and when you leave the note, reopen it, it works ?

you have the same text you wrote ?

Bables55 commented 5 years ago

I edited a new note and an existing note. No errors are displayed for either edit. There are no errors with stars, colors, keywords, text styles, copy and paste, etc.

PhieF commented 5 years ago

OK and is you put the line back the error comes back ?

this is an important line :P

Bables55 commented 5 years ago

There is no error now.

Bables55 commented 5 years ago

When I restore line 685, the error resumes.

PhieF commented 5 years ago

Grumpf can you replace

$tmppath = tempnam(sys_get_temp_dir(), uniqid().".sqd");

by

$tmppath = tempnam(sys_get_temp_dir(), uniqid()."test.sqd");

just using another name to see if there is an issue with the tmp file

Bables55 commented 5 years ago
[PHP] Error: fclose(): supplied resource is not a valid stream resource at /NEXTCLOUD/apps/carnet/lib/Controller/NoteController.php#687

POST /index.php/apps/carnet/note/saveText

I replaced it with "test.sqd". I commented out without deleting the original. #687 is fclose($tmph);

Bables55 commented 5 years ago

oc_carnet_metadata

I'm looking at a DB table, but is it correct that the above table is empty? After deleting carnet.app yesterday, I manually deleted the above table and the carnet record of oc_appconfig.

PhieF commented 5 years ago

Yep it's not a sql issue what happens if you add once again if($tmph)

just before fclose($tmph);

Bables55 commented 5 years ago

if($tmph) fclose($tmph);

or

if($tmph) { fclose($tmph); }

Both display the same error.

PhieF commented 5 years ago

They are both corrects :)

PhieF commented 5 years ago

I've received this by mail "I ran occ maintenance:repair. Then the error disappears."

the error is back again ? :S

Bables55 commented 5 years ago

Just because the server was sluggish, there were actually errors.

Bables55 commented 5 years ago

May I delete "fclose($tmph);"? Does this cause any new problems with this?

PhieF commented 5 years ago

It should be ok to do this...

Bables55 commented 5 years ago

I'm updated 0.14.0. A new error has occurred. Occurs when Carnet is launched for the first time. Switch to a different app (eg, calendar etc) and return to Carnet. This error only occurs once at startup if the user continues to use Carnet.

[PHP] Error: filemtime(): stat failed for /MY-NEXTCLOUD/apps/carnet/templates/CarnetElectron/reader/libs/jquery.printElement.min.js at /MY-NEXTCLOUD/apps/carnet/templates/writer.php#15

GET /index.php/apps/carnet/writer?path=untitled.sqd

There is also an error in NoteController.php when saving data.

PhieF commented 5 years ago

This error isn't really important, but you should comment fclose($tmph); again :(

hifihedgehog commented 5 years ago

This error isn't really important, but you should comment fclose($tmph); again :(

This. The app absolutely works, but having pages of errors due to a errant stray line of code can be irksome.