nov1n / RemarkablePocket

Synchronize Pocket articles with the Remarkable tablet.
GNU General Public License v3.0
142 stars 8 forks source link

Error occurred during sync: Bad request #28

Closed Plougheld closed 1 month ago

Plougheld commented 3 months ago

I'm getting this error when trying to run the sync. Installation seemed to go fine, although I had to change the link from localhost to the actual ip adress when authorizing for Pocket.

It is authorized correctly on the Pocket and Remarkable websites.

This is what the docker logs tell me:

[2024-07-18 23:25:56] User: xxxxx@xxxx.com, SyncVersion: 15 [2024-07-18 23:25:56] Starting sync... [2024-07-18 23:25:57] Found 0 read article(s) on Remarkable. [2024-07-18 23:25:58] Error occurred during sync: Bad request [2024-07-18 23:25:58] Next sync in 1h.

Anybody able to help me with this?

jsainzvela commented 3 months ago

Same error here, seems like something has changed in the Pocket protocol :(

Plougheld commented 3 months ago

So no hope of fixing this?

nov1n commented 3 months ago

I'll have a look, but I'm not very optimistic. The https://github.com/juruen/rmapi project I used is archived and unmaintained, so if they indeed changed the protocol it will be difficult to fix.

Plougheld commented 3 months ago

Thank you very much. I dont know if it helps but it looks like the sync from remarkable is working fine, it is the pocket sync that fails

nov1n commented 1 month ago

I just tested a fresh install on my Mac and it ran fine.

Can you try to delete the following files/directories:

And paste the output of:

docker run -it --env TZ=Europe/Amsterdam -p 65112:65112 -v ~/.remarkable-pocket:/root/.remarkable-pocket -v ~/.rmapi:/root/.rmapi -v ~/.rmapi-cache:/root/.cache/rmapi ghcr.io/nov1n/remarkable-pocket:0.4.0 -v

-v enables verbose logging, so that might give me some more info about what's going wrong.

Plougheld commented 1 month ago

Thank you for responding. I deleted the directories you mentioned and copied your command. This is what it gave me:

[2024-09-07 20:51:46] Created temporary storage directory: /tmp/1599369767278819068. [2024-09-07 20:51:46] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nl.carosi.remarkablepocket.MetadataProvider': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pocket' defined in nl.carosi.remarkablepocket.SyncApplication: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [pl.codeset.pocket.Pocket]: Factory method 'pocket' threw exception; nested exception is java.lang.RuntimeException: Could not connect to Pocket [2024-09-07 20:51:46]

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. [2024-09-07 20:51:46] Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nl.carosi.remarkablepocket.MetadataProvider': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pocket' defined in nl.carosi.remarkablepocket.SyncApplication: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [pl.codeset.pocket.Pocket]: Factory method 'pocket' threw exception; nested exception is java.lang.RuntimeException: Could not connect to Pocket at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:143) at nl.carosi.remarkablepocket.SyncCommand.call(SyncCommand.java:125) at nl.carosi.remarkablepocket.SyncCommand.call(SyncCommand.java:16) at picocli.CommandLine.executeUserObject(CommandLine.java:1953) at picocli.CommandLine.access$1300(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352) at picocli.CommandLine$RunLast.handle(CommandLine.java:2346) at picocli.CommandLine$RunLast.handle(CommandLine.java:2311) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179) at picocli.CommandLine.execute(CommandLine.java:2078) at nl.carosi.remarkablepocket.SyncCommand.main(SyncCommand.java:93) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pocket' defined in nl.carosi.remarkablepocket.SyncApplication: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [pl.codeset.pocket.Pocket]: Factory method 'pocket' threw exception; nested exception is java.lang.RuntimeException: Could not connect to Pocket at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ... 26 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [pl.codeset.pocket.Pocket]: Factory method 'pocket' threw exception; nested exception is java.lang.RuntimeException: Could not connect to Pocket at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ... 42 common frames omitted Caused by: java.lang.RuntimeException: Could not connect to Pocket at nl.carosi.remarkablepocket.SyncApplication.pocket(SyncApplication.java:45) at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$bc10bf6f.CGLIB$pocket$1() at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$bc10bf6f$$FastClassBySpringCGLIB$$493da909.invoke() at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$bc10bf6f.pocket() at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ... 43 common frames omitted Caused by: java.nio.file.FileSystemException: /root/.remarkable-pocket: Device or resource busy at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(Unknown Source) at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source) at java.base/java.nio.file.Files.delete(Unknown Source) at nl.carosi.remarkablepocket.PocketAuthenticator.getAuth(PocketAuthenticator.java:46) at nl.carosi.remarkablepocket.SyncApplication.pocket(SyncApplication.java:43) ... 53 common frames omitted org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nl.carosi.remarkablepocket.MetadataProvider': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pocket' defined in nl.carosi.remarkablepocket.SyncApplication: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [pl.codeset.pocket.Pocket]: Factory method 'pocket' threw exception; nested exception is java.lang.RuntimeException: Could not connect to Pocket at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:143) at nl.carosi.remarkablepocket.SyncCommand.call(SyncCommand.java:125) at nl.carosi.remarkablepocket.SyncCommand.call(SyncCommand.java:16) at picocli.CommandLine.executeUserObject(CommandLine.java:1953) at picocli.CommandLine.access$1300(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352) at picocli.CommandLine$RunLast.handle(CommandLine.java:2346) at picocli.CommandLine$RunLast.handle(CommandLine.java:2311) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179) at picocli.CommandLine.execute(CommandLine.java:2078) at nl.carosi.remarkablepocket.SyncCommand.main(SyncCommand.java:93) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pocket' defined in nl.carosi.remarkablepocket.SyncApplication: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [pl.codeset.pocket.Pocket]: Factory method 'pocket' threw exception; nested exception is java.lang.RuntimeException: Could not connect to Pocket at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ... 26 more Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [pl.codeset.pocket.Pocket]: Factory method 'pocket' threw exception; nested exception is java.lang.RuntimeException: Could not connect to Pocket at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ... 42 more Caused by: java.lang.RuntimeException: Could not connect to Pocket at nl.carosi.remarkablepocket.SyncApplication.pocket(SyncApplication.java:45) at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$bc10bf6f.CGLIB$pocket$1() at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$bc10bf6f$$FastClassBySpringCGLIB$$493da909.invoke() at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$bc10bf6f.pocket() at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ... 43 more Caused by: java.nio.file.FileSystemException: /root/.remarkable-pocket: Device or resource busy at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(Unknown Source) at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source) at java.base/java.nio.file.Files.delete(Unknown Source) at nl.carosi.remarkablepocket.PocketAuthenticator.getAuth(PocketAuthenticator.java:46) at nl.carosi.remarkablepocket.SyncApplication.pocket(SyncApplication.java:43) ... 53 more

marsop commented 1 month ago

I am experiencing a similar problem. First I was getting a HTTPStatus 410 and starting from a fresh configuration has not solved the issue.

nov1n commented 1 month ago

I had a look and this looks to be because of corrupt cache files. I added the fix to the FAQ section in the README.

TLDR: run this command in a terminal and try again:

rm -rf ~/.remarkable-pocket ~/.rmapi ~/.rmapi-cache

Although this will fix this issue you'll likely run into this next. I'm currently investigating how to fix it.

Feel free to close this issue if it works for you, and keep an eye on the other issue for a new fix.

Plougheld commented 1 month ago

I ran the command you suggested and reinstalled the latest version 0.5.0 and now everything works. Thank you so much for all your help.