nextcloud / notes

✎ Distraction-free notes and writing
https://apps.nextcloud.com/apps/notes
GNU Affero General Public License v3.0
604 stars 132 forks source link

App Unable to Read Notes From Server After Update to 4.9 #1177

Closed kn0wmad closed 8 months ago

kn0wmad commented 9 months ago

"Error from Nextcloud server: Reading notes from filesystem has failed. (Error)"

Attempted to remove and re-add folder path, attempted to uninstall and re-install app, neither fixed issue

Steps to reproduce

  1. Update to latest Notes
  2. Visit Notes web app in NC
  3. See error

Expected behaviour

Notes should be read from FS

Actual behaviour

Notes unable to read existing path

Server

Please complete the following information.

Nextcloud configuration:

``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder ```

Client

Please complete the following information.

Log files

Add relevant parts of your nextcloud.log and/or your browser's JavaScript console here.

juliushaertl commented 9 months ago

Add relevant parts of your nextcloud.log and/or your browser's JavaScript console here.

Can you check the logs?

GuestJim commented 9 months ago

I'm getting the same error message when I try using Notes, and here's what it shows in the logs for each attempt:


[notes] Error: Error: Undefined constant OCP\Share\IShare::TYPE_SCIENCEMESH at <>

  1. /var/www/html/custom_apps/notes/lib/Service/Note.php line 109 OCA\Notes\Service\NoteUtil->getShareTypes(OC\Files\Node\File {})
  2. /var/www/html/custom_apps/notes/lib/Controller/Helper.php line 62 OCA\Notes\Service\Note->getData(["etag","content"])
  3. /var/www/html/custom_apps/notes/lib/Controller/Helper.php line 114 OCA\Notes\Controller\Helper->getNoteData(OCA\Notes\Service\Note {}, ["etag","content"], OCA\Notes\Db\Meta {id: 25089})
  4. <> OCA\Notes\Controller\Helper->OCA\Notes\Controller{closure}(" sensitive parameters replaced ")
  5. /var/www/html/custom_apps/notes/lib/Controller/Helper.php line 113 array_map(Closure {}, ["*** sensitive ... "])
  6. /var/www/html/custom_apps/notes/lib/Controller/NotesController.php line 71 OCA\Notes\Controller\Helper->getNotesAndCategories(0, ["etag","content"])
  7. /var/www/html/custom_apps/notes/lib/Service/Util.php line 26 OCA\Notes\Controller\NotesController->OCA\Notes\Controller{closure}(" sensitive parameters replaced ")
  8. /var/www/html/custom_apps/notes/lib/Controller/Helper.php line 140 OCA\Notes\Service\Util::retryIfLocked(Closure {})
  9. /var/www/html/custom_apps/notes/lib/Controller/NotesController.php line 97 OCA\Notes\Controller\Helper->handleErrorResponse(Closure {})
  10. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 225 OCA\Notes\Controller\NotesController->index(0)
    1. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 133 OC\AppFramework\Http\Dispatcher->executeController(OCA\Notes\Controller\NotesController {}, "index")
    2. /var/www/html/lib/private/AppFramework/App.php line 172 OC\AppFramework\Http\Dispatcher->dispatch(OCA\Notes\Controller\NotesController {}, "index")
    3. /var/www/html/lib/private/Route/Router.php line 298 OC\AppFramework\App::main("OCA\Notes\Controller\NotesController", "index", OC\AppFramework\ ... {}, ["notes.notes.index"])
    4. /var/www/html/lib/base.php line 1047 OC\Route\Router->match("/apps/notes/notes")
    5. /var/www/html/index.php line 36 OC::handleRequest()

GET /apps/notes/notes from ... by jim at 2023-12-09T15:37:54+00:00

kn0wmad commented 9 months ago

Add relevant parts of your nextcloud.log and/or your browser's JavaScript console here.

Can you check the logs?

Apologies, I didn't catch anything relevant first time around:

"app":"notes","method":"GET","url":"/apps/notes/notes","message":"Controller failed with 
Error","userAgent":"Mozilla/5.0 (Windows NT 10.0; rv:120.0) Gecko/20100101 
Firefox/120.0","version":"25.0.5.1","exception":{"Exception":"Error","Message":"Undefined constant OCP\\Share
\\IShare::TYPE_SCIENCEMESH","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/notes/lib/Service
/Note.php","line":109,"function":"getShareTypes","class":"OCA\\Notes\\Service\\NoteUtil","type":"->","args":[["OC\\Files
\\Node\\File"]]},{"file":"/var/www/html/custom_apps/notes/lib/Controller
/Helper.php","line":62,"function":"getData","class":"OCA\\Notes\\Service\\Note","type":"->","args":[["etag","content"]]},
{"file":"/var/www/html/custom_apps/notes/lib/Controller/Helper.php","line":114,"function":"getNoteData","class":"OCA\\Notes\\Controller\\Helper","type":"->","args":[["OCA
\\Notes\\Service\\Note"],["etag","content"],["OCA\\Notes\\Db\\Meta",608]]},{"function":"OCA\\Notes\\Controller
\\{closure}","class":"OCA\\Notes\\Controller\\Helper","type":"->","args":["*** sensitive parameters replaced ***"]},
{"file":"/var/www/html/custom_apps/notes/lib/Controller/Helper.php","line":113,"function":"array_map","args":
[["Closure"],["*** sensitive parameters replaced ***",["OCA\\Notes\\Service\\MetaNote",["OCA\\Notes\\Service\\Note"],
["OCA\\Notes\\Db\\Meta",607]],["OCA\\Notes\\Service\\MetaNote",["OCA\\Notes\\Service\\Note"],["OCA\\Notes
\\Db\\Meta",606]],["OCA\\Notes\\Service\\MetaNote",["OCA\\Notes\\Service\\Note"],["OCA\\Notes\\Db\\Meta",605]],
["OCA\\Notes\\Service\\MetaNote",["OCA\\Notes\\Service\\Note"],["OCA\\Notes\\Db\\Meta",611]],"And 3 more entries, 
set log level to debug to see all entries"]]},{"file":"/var/www/html/custom_apps/notes/lib/Controller
/NotesController.php","line":71,"function":"getNotesAndCategories","class":"OCA\\Notes\\Controller
\\Helper","type":"->","args":[0,["etag","content"]]},{"file":"/var/www/html/custom_apps/notes/lib/Service
/Util.php","line":26,"function":"OCA\\Notes\\Controller\\{closure}","class":"OCA\\Notes\\Controller
\\NotesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/custom_apps
/notes/lib/Controller/Helper.php","line":140,"function":"retryIfLocked","class":"OCA\\Notes\\Service
\\Util","type":"::","args":[["Closure"]]},{"file":"/var/www/html/custom_apps/notes/lib/Controller
/NotesController.php","line":97,"function":"handleErrorResponse","class":"OCA\\Notes\\Controller
\\Helper","type":"->","args":[["Closure"]]},{"file":"/var/www/html/lib/private/AppFramework
/Http/Dispatcher.php","line":225,"function":"index","class":"OCA\\Notes\\Controller\\NotesController","type":"->","args":
[0]},{"file":"/var/www/html/lib/private/AppFramework
/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http
\\Dispatcher","type":"->","args":[["OCA\\Notes\\Controller\\NotesController"],"index"]},{"file":"/var/www/html/lib/private
/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http
\\Dispatcher","type":"->","args":[["OCA\\Notes\\Controller\\NotesController"],"index"]},{"file":"/var/www/html/lib/private
/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Notes
\\Controller\\NotesController","index",["OC\\AppFramework\\DependencyInjection\\DIContainer"],
["notes.notes.index"]]},{"file":"/var/www/html/lib/base.php","line":1047,"function":"match","class":"OC\\Route
\\Router","type":"->","args":["/apps/notes/notes"]},{"file":"/var/www
/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www
/html/custom_apps/notes/lib/Service/NoteUtil.php","Line":232,"message":"Controller failed with Error","exception":
{},"CustomMessage":"Controller failed with Error"}}
MattDHill commented 8 months ago

I have the same issue, see closed ticket above for logs

neod123 commented 8 months ago

Same issue also on my side with 4.9

Error: Undefined constant OCP\Share\IShare::TYPE_SCIENCEMESH
/var/www/nextcloud/apps/notes/lib/Service/Note.php - line 109:

OCA\Notes\Service\NoteUtil->getShareTypes()

/var/www/nextcloud/apps/notes/lib/Controller/Helper.php - line 62:

OCA\Notes\Service\Note->getData()

/var/www/nextcloud/apps/notes/lib/Controller/Helper.php - line 114:

OCA\Notes\Controller\Helper->getNoteData()

<<closure>>

OCA\Notes\Controller\Helper->OCA\Notes\Controller\{closure}("*** sensiti ... *")

/var/www/nextcloud/apps/notes/lib/Controller/Helper.php - line 113:

array_map()

/var/www/nextcloud/apps/notes/lib/Controller/NotesController.php - line 71:

OCA\Notes\Controller\Helper->getNotesAndCategories()

/var/www/nextcloud/apps/notes/lib/Service/Util.php - line 26:

OCA\Notes\Controller\NotesController->OCA\Notes\Controller\{closure}("*** sensiti ... *")

/var/www/nextcloud/apps/notes/lib/Controller/Helper.php - line 140:

OCA\Notes\Service\Util::retryIfLocked()

/var/www/nextcloud/apps/notes/lib/Controller/NotesController.php - line 97:

OCA\Notes\Controller\Helper->handleErrorResponse()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 230:

OCA\Notes\Controller\NotesController->index()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 137:

OC\AppFramework\Http\Dispatcher->executeController()

/var/www/nextcloud/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1050:

OC\Route\Router->match()

/var/www/nextcloud/index.php - line 36:

OC::handleRequest()
jschmuecking commented 8 months ago

I do have the exact same problem and the logs look the same, too.

GuestJim commented 8 months ago

Just wanted to confirm 4.9.1 has resolved the issue for me. I hope it does for everyone else too.

kn0wmad commented 8 months ago

Solved, thank you for the quick fix