Application Quicknotes returns 404 on API calls

I have latest NC 27 version, running on PHP 8.2 (docker), with nginx as reverse proxy.

Everything works, including Quick Notes (latest version, updated manually) app via web. However, when I’m using Android App, I face instant failure after logging in.

I’ve debugged a bit and concluded, that problem is the following:

  • Application makes API call to quick notes, like so:
"GET /apps/quicknotes/api/v1/notes? HTTP/1.1" 404 12598 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.29.0" "-"

And receives 404, after which shows error.

  • What is more important is that with that 404 status, inside of the response there is a valid array with notes.
  • Digging deeper it shows that JSON response from application level is formed correctly. It has STATUS_OK set and inside it data is appropriate.
  • Here is the block of code from quicknotes app which forms output:
		$response = new JSONResponse($notes);
		$response->setETag(md5(json_encode($notes)));
		$response->setLastModified($lastModified);

		return $response;
  • So it seems that wrapper of NC for some reason treats such response as 404 and sets the status to it.

Have anyone encountered this issue or do you know where to dig? Other applications work via API without this kind of issue, having more or less the same lines which return results.

Thank you.

What does your Nextcloud log show?

Here is the log extract when running application:

{"reqId":"J5FvJOKb65pDHN3mZVi5","level":0,"time":"2024-06-26T10:21:39+00:00","remoteAddr":"[REDACTED_IP]","user":"[REDACTED_USER]","app":"video_converter","method":"GET","url":"/apps/quicknotes/api/v1/notes?","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.29.0","version":"27.1.10.2","data":{"app":"video_converter"}}
{"reqId":"J5FvJOKb65pDHN3mZVi5","level":0,"time":"2024-06-26T10:21:39+00:00","remoteAddr":"[REDACTED_IP]","user":"[REDACTED_USER]","app":"no app in context","method":"GET","url":"/apps/quicknotes/api/v1/notes?","message":"Session token invalidated before logout","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.29.0","version":"27.1.10.2","data":{"user":"[REDACTED_USER]"}}
{"reqId":"J5FvJOKb65pDHN3mZVi5","level":0,"time":"2024-06-26T10:21:39+00:00","remoteAddr":"[REDACTED_IP]","user":"[REDACTED_USER]","app":"no app in context","method":"GET","url":"/apps/quicknotes/api/v1/notes?","message":"Logging out","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.29.0","version":"27.1.10.2","data":{"user":"[REDACTED_USER]"}}
{"reqId":"J5FvJOKb65pDHN3mZVi5","level":0,"time":"2024-06-26T10:21:39+00:00","remoteAddr":"[REDACTED_IP]","user":"[REDACTED_USER]","app":"PHP","method":"GET","url":"/apps/quicknotes/api/v1/notes?","message":"DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated at /var/www/html/[REDACTED_DOMAIN]/apps/quicknotes/lib/Controller/NoteApiController.php#62","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.29.0","version":"27.1.10.2","data":{"app":"PHP"}}

Last message, telling about “Passing null to parameter #1” is actually in the method, that is returning list of notes, which means it’s hit correctly.