Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Can't sync new and updated entries" #72

Closed
keunes opened this issue Jul 15, 2021 · 13 comments
Closed

"Can't sync new and updated entries" #72

keunes opened this issue Jul 15, 2021 · 13 comments

Comments

@keunes
Copy link

keunes commented Jul 15, 2021

Hello

I used to use Readrops but it suddenly doesn't sync any-more. Looking for an alternative, I came across this app.

Install, log-in and initial sync were quickly done, but now I seem to have the same issue as in Readrops: I can't sync.
Screenshot_20210715-085535.png

Could this be related to recent changes in Nextcloud News?

@bubelov
Copy link
Owner

bubelov commented Jul 15, 2021

@keunes sure, it can be related. This app logs every error locally, you can go to Settings -> Exceptions and share this error here with a full stack trace. Maybe it will help us to understand what's going on

Also, could you provide your Android version, Nextcloud version and News server version?

@keunes
Copy link
Author

keunes commented Jul 15, 2021

This app logs every error locally … share this error here with a full stack trace

entriesimages.ImageProcessingException: Cannot download image by URL /images/uploads/mediaraad_amstelveen_2020.jpg
	at entriesimages.EntriesImagesRepository.log(EntriesImagesRepository.kt:185)
	at entriesimages.EntriesImagesRepository.access$log(EntriesImagesRepository.kt:23)
	at entriesimages.EntriesImagesRepository$syncPreview$2.invokeSuspend(EntriesImagesRepository.kt:151)
	at entriesimages.EntriesImagesRepository$syncPreview$2.invoke(Unknown Source:10)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
	at entriesimages.EntriesImagesRepository.syncPreview(EntriesImagesRepository.kt:73)
	at entriesimages.EntriesImagesRepository$syncPreviews$2$1$1$invokeSuspend$$inlined$forEach$lambda$1.invokeSuspend(EntriesImagesRepository.kt:54)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Caused by: java.lang.IllegalStateException: Unrecognized type of request: Request{/images/uploads/mediaraad_amstelveen_2020.jpg resize(1080,0)}
	at com.squareup.picasso.BitmapHunter$2.load(BitmapHunter.java:78)
	at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:219)
	at com.squareup.picasso.RequestCreator.get(RequestCreator.java:429)
	at entriesimages.EntriesImagesRepository$syncPreview$2.invokeSuspend(EntriesImagesRepository.kt:149)
	... 12 more

There's a gazillion of these - I just copied the most recent here.

Also, could you provide your Android version, Nextcloud version and News server version?

Sure :)
Android: 10
Nextcloud: 20.0.11
Nextcloud News: 16.0.0

(Maybe it's useful to add these questions to a GitHub template)

@bubelov
Copy link
Owner

bubelov commented Jul 15, 2021

@keunes you can ignore image processing exceptions, they just mean that some of the posts don't have thumbnail images. There should be an exception with the same title as on your screenshot, something about being unable to sync feed items

@keunes
Copy link
Author

keunes commented Jul 15, 2021

This one I guess?

java.lang.Exception: Can't sync new and updated entries
	at sync.NewsApiSync.sync(NewsApiSync.kt:117)
	at sync.NewsApiSync$sync$1.invokeSuspend(Unknown Source:12)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at android.os.Handler.handleCallback(Handler.java:883)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loop(Looper.java:214)
	at android.app.ActivityThread.main(ActivityThread.java:7397)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Caused by: java.lang.Exception: HTTPS request failed with error code 500
	at api.nextcloud.NextcloudNewsApiAdapter.toException(NextcloudNewsApiAdapter.kt:196)
	at api.nextcloud.NextcloudNewsApiAdapter.getNewAndUpdatedEntries(NextcloudNewsApiAdapter.kt:118)
	at api.NewsApiWrapper.getNewAndUpdatedEntries(NewsApiWrapper.kt:38)
	at entries.EntriesRepository$syncNewAndUpdated$2.invokeSuspend(EntriesRepository.kt:221)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

@bubelov
Copy link
Owner

bubelov commented Jul 15, 2021

@keunes right. So, your server returns error code 500, it looks like a server-side issue. Client side codes are usually in a range of 400-499. I'd recommend you to open your web interface and check Settings -> Logs. News server is pretty verbose and it might have written something important in global Nextcloud log

@keunes
Copy link
Author

keunes commented Jul 15, 2021

I'll have a look, thanks. Given that it does not have any issue with the initial fetch, it can't be a generic issue with my Nextcloud instance or News installation.

Wouldn't the server also return a 500 if the client uses a wrong/non-existant API call?

@bubelov
Copy link
Owner

bubelov commented Jul 16, 2021

@keunes server may do whatever it wants but it would mean it breaks the protocol. Invalid requests are expected to have response codes in the range 400-499. 500-599 range is reserved for server issues

@keunes
Copy link
Author

keunes commented Jul 25, 2021

Ok, small holiday in between, and just checked the server logs. I see the following very frequently. Also, it gets triggered when I pull to refresh in the Android app, so I guess this would be related :)

[index] Error: Exception: Argument 3 passed to OCA\News\Service\ItemServiceV2::findAllAfter() must be of the type int, float given, called in /var/www/nextcloud/apps/news/lib/Controller/ItemApiController.php on line 147 at <<closure>>

0. /var/www/nextcloud/lib/private/AppFramework/App.php line 152
   OC\AppFramework\Http\Dispatcher->dispatch(OCA\News\Controller\ItemApiController {}, "updated")
1. /var/www/nextcloud/lib/private/Route/Router.php line 309
   OC\AppFramework\App::main("OCA\\News\\Cont ... r", "updated", OC\AppFramework\ ... {}, {_route: "news.item_api.updated"})
2. /var/www/nextcloud/lib/base.php line 1008
   OC\Route\Router->match("/apps/news/api/v1-2/items/updated")
3. /var/www/nextcloud/index.php line 37
   OC::handleRequest()

GET /index.php/apps/news/api/v1-2/items/updated?lastModified=1626311408&type=3
from 192.168.xxx.xx by keunes at 2021-07-25T13:28:33+00:00

Also this one occurs frequently, but doesn't get triggered when refreshing feeds:

{
    "reqId":"QC9d8eKDhGxcpDxZHikr",
    "level":2,
    "time":"2021-07-25T09:50:19+00:00",
    "remoteAddr":"",
    "user":"--",
    "app":"news",
    "method":"",
    "url":"--",
    "message":"https://www.zuidwijk.com/feed/ read error : No parser can handle this stream",
    "userAgent":"--",
    "version":"20.0.11.1",
    "id":"60fd754113ecd"
}

Would this give you any hint? Should I open a bug report against Nextcloud News? Please let me know also if the full, original ('pure') log entry would help.

@keunes
Copy link
Author

keunes commented Jul 25, 2021

Same issue seems to be affecting other apps as well:

@bubelov
Copy link
Owner

bubelov commented Jul 25, 2021

@keunes I just checked the linked issues. Well, that sucks. That's one of the many reasons I'm getting less and less excited about NC and its core apps, it consistently fails at everything besides simple file sync. Looks like you need to re-install your OS in order to fix this issue (no joking).

I created this app in order to make NC experience a little more bearable, but I'm planning to switch to standalone mode (no server, no problems) and/or find a high quality and high performance back end and connect it to this app. I'm still committed to support NC back end, so it's not going away any time soon, but any suggested alternatives are welcome.

@keunes
Copy link
Author

keunes commented Jul 25, 2021

Thanks @bubelov for your reply. Reading up on the issues, an OS reinstall indeed seems necessary 😟

I really liked Flym, then had to move phones and looked into NC apps, to not have the issues with phones any-more. But I'd be interested in your work for a 'local' app (also because Flym is no longer).

@keunes keunes closed this as completed Jul 25, 2021
@mormegil-cz
Copy link
Contributor

Yeah, this change by the NC News app was a terrible idea. For others like me who cannot (or do not want to) replace HW/reinstall OS, I patched the app to restore 32bit support (unless I’m mistaken, there is really no point in the requirement!) in my fork (thanks for inspiration to shane-kerr!); I have cherry-picked the fix to the 16.x branch and deployed the modified files from this branch to my NC server. The reader app now syncs successfully again.

@bubelov
Copy link
Owner

bubelov commented Sep 8, 2021

I tried this thing today and it looks really good: https://miniflux.app/

The deployment is trivial since it's a single binary and it's also considerably faster than NC (it's written in Go). It will be supported in the next release, so there will be an alternative to NC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants