"401 Nicht berechtigt - "Project not found" with Nextcloud-synced Cospend project
STR
I have an old project (also old setup in Moneybuster), setup on Nextcloud Cospend, but since February 2024 all additions (and changes?) seem to be stuck in the queue (for one project at least) and not be synced.
It always tries to sync, loading for quite a while and then fails with:
Likely the same like this (translated):
Synchronization with project [project name] failed.
Error message:
401 Unauthorized
{"message":"Unauthorized action"}
Unauthorized action
The associated remote project might not exist anymore. If so, you could remove this project from MoneyBuster.
Here you can see the queue being stuck:
From that I conclude:
- last known working sync: 2024-01-29 (confirmed with Cospend)
I likely had some server downtime in between, but anyway, now it's all up and it should work as Nextcloud and Cospend all work. Also I can add stuff on Cospend as wanted.
Related
Possibly related to #128 However, I already use the fixed version there, but it seems to be making problems again. (also BTW, the old issue is not closed yet, but I assumed it is considered to be fixed) Thus I am opening a new issue.
System
Device: Fairphone 4 (FP4)
OS: Android 14, CalyxOS 5.6.0.
source: F-Droid
version: v. 0.1.18
Build-ID: AP1A.240405.002.A1.24506000
Cospend 1.6.1 Nextcloud 28.0.4
BTW
I can export the stuff as CSV as a workaround, but AFAIK Cospend has no CSV import functionality, so I am a bit stuck on how to recover from here…
I have saved a logcat and I have uploaded it here: https://gitlab.com/-/snippets/3701829
Interesting (though maybe unrelated?), there are these exceptions:
FATAL EXCEPTION: main
Process: net.eneiluj.moneybuster, PID: 11358
java.lang.RuntimeException: Unable to create service net.eneiluj.moneybuster.service.SyncService: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service net.eneiluj.moneybuster/.service.SyncService
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4878)
at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2365)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8501)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
Caused by: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service net.eneiluj.moneybuster/.service.SyncService
at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
at android.os.Parcel.readParcelableInternal(Parcel.java:5015)
at android.os.Parcel.readParcelable(Parcel.java:4997)
at android.os.Parcel.createExceptionOrNull(Parcel.java:3177)
at android.os.Parcel.createException(Parcel.java:3166)
at android.os.Parcel.readException(Parcel.java:3149)
at android.os.Parcel.readException(Parcel.java:3091)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6861)
at android.app.Service.startForeground(Service.java:775)
at net.eneiluj.moneybuster.service.SyncService.onCreate(SyncService.java:100)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4865)
... 9 more
[04-15 23:51:58.625 11383:11383 E/AndroidRuntime]
FATAL EXCEPTION: main
Process: net.eneiluj.moneybuster, PID: 11383
java.lang.RuntimeException: Unable to create service net.eneiluj.moneybuster.service.SyncService: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service net.eneiluj.moneybuster/.service.SyncService
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4878)
at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2365)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8501)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
Caused by: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service net.eneiluj.moneybuster/.service.SyncService
at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
at android.os.Parcel.readParcelableInternal(Parcel.java:5015)
at android.os.Parcel.readParcelable(Parcel.java:4997)
at android.os.Parcel.createExceptionOrNull(Parcel.java:3177)
at android.os.Parcel.createException(Parcel.java:3166)
at android.os.Parcel.readException(Parcel.java:3149)
at android.os.Parcel.readException(Parcel.java:3091)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6861)
at android.app.Service.startForeground(Service.java:775)
at net.eneiluj.moneybuster.service.SyncService.onCreate(SyncService.java:100)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4865)
... 9 more
Probably relevant:
[04-19 21:50:50.912 13949:25041 E/SyncTask]
Catch SSO HTTP req FAILED
com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException: HTTP-Anfrage ist fehlgeschlagen mit HTTP-Statuscode: 401
at net.eneiluj.moneybuster.util.VersatileProjectSyncClient.requestServer(VersatileProjectSyncClient.java:1249)
at net.eneiluj.moneybuster.util.VersatileProjectSyncClient.getMembers(VersatileProjectSyncClient.java:916)
at net.eneiluj.moneybuster.persistence.MoneyBusterServerSyncHelper$SyncTask.pushLocalChanges(MoneyBusterServerSyncHelper.java:367)
at net.eneiluj.moneybuster.persistence.MoneyBusterServerSyncHelper$SyncTask.doInBackground(MoneyBusterServerSyncHelper.java:351)
at net.eneiluj.moneybuster.persistence.MoneyBusterServerSyncHelper$SyncTask.doInBackground(MoneyBusterServerSyncHelper.java:298)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.io.IOException: {"message":"Project not found"}
... 11 more
I can provide unfiltered logcat privately upon request.
Note maybe you should possibly consider improving your logging, I see many kinda unrelated log entries [Entry from thing] get date is … year 2024
and then set formatted date item otig 2024-… transformed to ….24
or even [GETITEM 7/61]
. Note this is problematic as:
- it spams the log with likely not helpful logging (of private data) or is it?
- it is not included in my filtered log as it does not mention the term
MoneyBuser
/ app ID, so it's hard to filter by app. (I always thought all apps have that, but in this case it is shown just asITemAdapter
or even11
[as the title in my log viewer], which is obviously not really helpful?)