Synchronize Pocket articles with the Remarkable tablet.

Overview

Example article

Remarkable Pocket synchronizes articles from Pocket to your Remarkable tablet. It can be run on your computer or on a server. Because it does not run on the device itself this approach saves battery life, and is resistant to Remarkable software updates.

An example run of the program can be found below:

[2021-11-02 14:21:22] Starting sync...
[2021-11-02 14:21:25] Found 1 read article(s) on Remarkable.
[2021-11-02 14:21:25] (1/1) Marking 'Getting Unstuck' as read on Pocket...
[2021-11-02 14:21:25] (1/1) Deleting 'Getting Unstuck' from Remarkable...
[2021-11-02 14:21:27] Found 5 unread article(s) on Remarkable. Downloading 5 more from Pocket.
[2021-11-02 14:21:27] (1/5) Downloading: 'What Modules Are About'.
[2021-11-02 14:21:33] (2/5) Downloading: 'Pursue High-quality Leisure'.
[2021-11-02 14:21:39] (3/5) Downloading: 'Hunting down a C memory leak in a Go program'.
[2021-11-02 14:21:45] (4/5) Downloading: 'Beginner's Guide To Abstraction'.
[2021-11-02 14:22:03] (5/5) Downloading: 'Timer Modules in Microcontrollers'.
[2021-11-02 14:22:03] No content found. Skipping...
[2021-11-02 14:22:15] (6/5) Downloading: 'SSH Tunneling Explained'.
[2021-11-02 14:22:33] Uploading 5 article(s) to Remarkable.
[2021-11-02 14:22:33] (1/5) Uploading: 'What Modules Are About.epub'.
[2021-11-02 14:22:34] (2/5) Uploading: 'Pursue High-quality Leisure.epub'.
[2021-11-02 14:22:34] (3/5) Uploading: 'Hunting down a C memory leak in a Go program.epub'.
[2021-11-02 14:22:34] (4/5) Uploading: 'Beginner's Guide To Abstraction.epub'.
[2021-11-02 14:22:34] (5/5) Uploading: 'SSH Tunneling Explained.epub'.
[2021-11-02 14:22:35] Completed sync in 1m 13s.
[2021-11-02 14:22:35] Next sync in 30m.
Click here to see what a downloaded article looks like on the Remarkable. An example article on the Remarkable.

Features

  • No installation required. The application can be run with a single command.
  • Works on Remarkable 1 and 2.
  • Full support for images, code blocks, and formulas.
  • Articles are downloaded as epubs. This allows you to customize the font, font size, margins, etc.
  • Automatically archive read articles on Pocket. When you finish reading an article and close it while on the last page, it will be automatically deleted from the Remarkable and archived on Pocket. A new unread article will be downloaded in its place.
  • Download articles from Pocket with a given tag. If a tag-filter (see Configuration) is supplied then only articles with that tag will be downloaded.

Usage

The easiest way to run the application is using Docker. First install Docker for your platform from https://docs.docker.com/get-docker/. Then run the following command to start the application on Linux or Mac (I have not tested it on Windows yet):

touch ~/.remarkable-pocket && docker run -it --env TZ=$(date +%Z) -p 65112:65112 -v ~/.remarkable-pocket:/root/.remarkable-pocket ghcr.io/nov1n/remarkable-pocket:0.0.3

The first time you run the application, you will be asked to authorize Pocket and Remarkable Cloud. Once you have done this subsequent runs will read the credentials from the ~/.remarkable-pocket file.

By default articles are synchronized to the /Pocket/ directory on the Remarkable every 30 minutes.

TIP: If you want to launch the program on startup and keep it running in the background you can use launchd (on Mac) or systemd (on Linux). On Mac copy this file to ~/Library/LaunchAgents/ followed by: launchctl load -w nl.carosi.remarkable-pocket.plist. Logs will be sent to ~/.remarkable-pocket.log.

Configuration

The default configuration can be changed by providing command-line arguments. Simply append these to the docker run command. Below is a list of all available options.

Usage: remarkable-pocket [-hnorV] [-d=<storageDir>] [-f=<tagFilter>] [-i=<interval>] [-l=<articleLimit>]
Synchronizes articles from Pocket to the Remarkable tablet.
  -f, --tag-filter=<tagFilter>
                            Only download Pocket articles with the this tag.
  -o, --run-once            Run the synchronization once and then exit.
  -n, --no-archive          Don't archive read articles.
  -l, --article-limit=<articleLimit>
                            The maximum number of Pocket articles to be present on the Remarkable.
                              Default: 10
  -i, --interval=<interval> The interval between subsequent synchronizations.
                              Default: 60m
  -r, --reset-credentials   Reset all credentials.
  -d, --storage-dir=<storageDir>
                            The storage directory on the Remarkable in which to store downloaded Pocket articles.
                              Default: /Pocket/
  -v, --verbose             Enable verbose logging.
  -h, --help                Show this help message and exit.
  -V, --version             Print version information and exit.

Limitations

  • Articles behind a paywall cannot be downloaded.
  • Articles on websites with sophisticated DDOS protection cannot be downloaded.
  • Articles that use javascript to load the the content cannot be downloaded.

Build Instructions

The project uses Gradle as a build tool and can be built using the gradle build command. This will generate jars in build/libs/. To run the jar, use the java -jar build/libs/remarkable-pocket-x.x.x.jar command, replacing x.x.x with the correct version.

Building docker

To build the docker image run gradle jib. This will use a dynamically generated Dockerfile based on the configuration in the jib section of the build.gradle file. To run the image, see the command in the Usage section.

Other package formats

If you would like to package the application in another format e.g. deb, nix or AUR, I'm happy to review a Pull Request.

Thanks

Support

"Buy Me A Coffee" if you want to say thanks. :-)

Disclaimer

The author(s) and contributor(s) are not associated with reMarkable AS, Norway. reMarkable is a registered trademark of reMarkable AS in some countries. Please see https://remarkable.com for their product.

Comments
  • Sync stopped working

    Sync stopped working

    [2022-01-12 23:22:05] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nl.carosi.remarkablepocket.RemarkableService': Invocation of init method failed; nested exception is java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because the return value of "es.jlarriba.jrmapi.Jrmapi.listDocs()" is null

    bug 
    opened by marcusramberg 22
  • Error when running command:

    Error when running command:

    Hello,

    I had it working fine on my Pi 4 via docker, but now when I try to re-run the command, it returns a bunch of error messages, starting with

    Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nl.carosi.remarkablepocket.SyncService': Unsatisfied dependency expressed through constructor parameter 6; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.time.Duration'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@org.springframework.beans.factory.annotation.Value java.time.Duration] for value 'PT300'; nested exception is java.lang.IllegalArgumentException: 'PT300' is not a valid ISO-8601 duration

    I'm at a loss as to what to try next. I've already tried restarting the Pi and stopping and restarting the container via Portainer. Any help is greatly appreciated! It was working great for the first 2 syncs!

    opened by Raiders95 13
  • Error during sync: entry

    Error during sync: entry

    Hi The tool is wonderful, but I encountered a second misbehaviour, that I cannot get rid off...

    [2022-09-12 08:12:05] Starting sync... [2022-09-12 08:12:06] Error occurred during sync: entry [2022-09-12 08:12:06] Next sync in 1h.

    I removed the ~/.remarkable-pocket and re-initialised the rights, but it is still blocked... Any idea ?

    bug 
    opened by francoissabot 13
  • UnsatisfiedDependencyException: Cannot run program

    UnsatisfiedDependencyException: Cannot run program "/usr/local/bin/rmapi": error=2, No such file or directory

    Hi there.

    After the issue with the new API version I found some time to give RemarkablePocket another spin. Unfortunately, the software crashes with a ton of exceptions, apparently one caused by the other.

    It would be great to get some help on this. Thanks very much!

    I removed the three files and ran the command described in the Readme:

    $ touch ~/.remarkable-pocket ~/.rmapi && mkdir -p ~/.rmapi-cache && docker run -it --env TZ=Europe/Amsterdam -p 65112:65112 -v ~/.remarkable-pocket:/root/.remarkable-pocket:Z -v ~/.rmapi:/root/.rmapi:Z -v ~/.rmapi-cache:/root/.cache/rmapi:Z ghcr.io/nov1n/remarkable-pocket:0.2.2
    

    I only added :Z to the volume mappings which is necessary to work with SELinux and also tried version 0.2.2 which seems to be released but not mentioned in the Readme.

    The first line output is the following:

    [2022-10-08 15:32:08] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nl.carosi.remarkablepocket.ArticleValidator': Unsatisfied dependency expressed through constructor parameter 0; nested exception is 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 'nl.carosi.remarkablepocket.RemarkableApi': Invocation of init method failed; nested exception is java.lang.RuntimeException: Could not authenticate to Remarkable API

    I believe this is an accumulation of all other exceptions output in red in the log. The second one being:

    Caused by: java.io.IOException: Cannot run program "/usr/local/bin/rmapi": error=2, No such file or directory

    opened by andypillip 10
  • Fresh install crash

    Fresh install crash

    Hi, Wanted to test that using docker-compose, but it crash at first run. Here is my docker-compose:

    version: '3'
    
    services:
      remarkable-pocket:
        image: ghcr.io/nov1n/remarkable-pocket:0.3.0
        restart: always
        environment:
          - TZ=Europe/Paris
        ports:
          - "65112:65112"
        volumes:
          - ./data/remarkable-pocket:/root/.remarkable-pocket
          - ./data/rmapi:/root/.rmapi
          - ./data/rmapi-cache:/root/.cache/rmapi
    

    Docker version: 20.10.21, build baeda1f82a Docker compose: installed as a plugin (v2)

    I couldn't guess much from the standard error. The debug logs says it's not connected to the internet, but it is.

    But I cannot debug further, as I haven't found the Dockerfile. Where is it?

    Standard error output

    [2022-10-29 12:18:19] 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 authenticate with Pocket
    [2022-10-29 12:18:19] 
    
    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
    [2022-10-29 12:18:19] 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 authenticate with 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 authenticate with 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 authenticate with 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 authenticate with Pocket
            at nl.carosi.remarkablepocket.SyncApplication.pocket(SyncApplication.java:44)
            at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$9da5f0aa.CGLIB$pocket$1(<generated>)
            at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$9da5f0aa$$FastClassBySpringCGLIB$$2d43d3de.invoke(<generated>)
            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$$9da5f0aa.pocket(<generated>)
            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:42)
            ... 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 authenticate with 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 authenticate with 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 authenticate with 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 authenticate with Pocket
            at nl.carosi.remarkablepocket.SyncApplication.pocket(SyncApplication.java:44)
            at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$9da5f0aa.CGLIB$pocket$1(<generated>)
            at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$9da5f0aa$$FastClassBySpringCGLIB$$2d43d3de.invoke(<generated>)
            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$$9da5f0aa.pocket(<generated>)
            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:42)
            ... 53 more
    

    Debug error output: https://pastebin.com/ZXGwrW0n

    opened by sinux-l5d 9
  • Update rmapi to v0.0.25

    Update rmapi to v0.0.25

    • Fixes the issue authenticating to the Remarkable API.
    • Speeds up building the document tree on startup.
    • Adds a script to automate updating rmapi binaries.
    opened by nov1n 5
  • Error on M1 chip Macbook

    Error on M1 chip Macbook

    Hello! I'm new to use of Docker, but trying to run this on a Macbook Pro with the newer M1 chip and I think that's the root of the issue I'm encountering.

    Here's the command I'm running and output:

    ➜  RemarkablePocket git:(main) touch ~/.remarkable-pocket ~/.rmapi && mkdir -p ~/.rmapi-cache && 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.2.2@sha256:670deb45f64aa78e67aba8fb34159e19b554ad1ef055dc021530308542522364
    Unable to find image 'ghcr.io/nov1n/remarkable-pocket:0.2.2@sha256:670deb45f64aa78e67aba8fb34159e19b554ad1ef055dc021530308542522364' locally
    ghcr.io/nov1n/remarkable-pocket@sha256:670deb45f64aa78e67aba8fb34159e19b554ad1ef055dc021530308542522364: Pulling from nov1n/remarkable-pocket
    2b55860d4c66: Pull complete
    49a58ffb4a94: Pull complete
    89d66e37a1ba: Pull complete
    88abbee52af5: Pull complete
    1d9fdd2e27fa: Pull complete
    58ec3c005ac0: Pull complete
    107cfaeeff63: Pull complete
    45db46aa51cb: Pull complete
    ef33a0271b9f: Pull complete
    Digest: sha256:670deb45f64aa78e67aba8fb34159e19b554ad1ef055dc021530308542522364
    Status: Downloaded newer image for ghcr.io/nov1n/remarkable-pocket@sha256:670deb45f64aa78e67aba8fb34159e19b554ad1ef055dc021530308542522364
    WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
    [2022-10-01 20:47:01] Visit https://getpocket.com/auth/authorize?request_token=REDACTED&redirect_uri=http://localhost:65112/redirect and authorize this application.
    
    [2022-10-01 20:47:11] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nl.carosi.remarkablepocket.ArticleValidator': Unsatisfied dependency expressed through constructor parameter 0; nested exception is 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.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
    [2022-10-01 20:47:11]
    
    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
    [2022-10-01 20:47:12] Application run failed
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nl.carosi.remarkablepocket.ArticleValidator': Unsatisfied dependency expressed through constructor parameter 0; nested exception is 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.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
            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.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.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
            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.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.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.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
            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)
            ... 40 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.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
            at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
            at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
            ... 56 common frames omitted
    Caused by: java.lang.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
            at pl.codeset.pocket.IOUtil.toBytes(IOUtil.java:13)
            at pl.codeset.pocket.HttpClient.lambda$readResponse$0(HttpClient.java:41)
            at java.base/java.util.Optional.orElseGet(Unknown Source)
            at pl.codeset.pocket.HttpClient.readResponse(HttpClient.java:39)
            at pl.codeset.pocket.HttpClient.send(HttpClient.java:25)
            at pl.codeset.pocket.PocketAuthFactory.generateAccessToken(PocketAuthFactory.java:57)
            at pl.codeset.pocket.PocketAuthFactory.createForCode(PocketAuthFactory.java:23)
            at pl.codeset.pocket.PocketAuthFactory.create(PocketAuthFactory.java:40)
            at nl.carosi.remarkablepocket.PocketAuthenticator.authenticate(PocketAuthenticator.java:98)
            at nl.carosi.remarkablepocket.PocketAuthenticator.authAndStore(PocketAuthenticator.java:66)
            at nl.carosi.remarkablepocket.PocketAuthenticator.getAuth(PocketAuthenticator.java:52)
            at nl.carosi.remarkablepocket.SyncApplication.pocket(SyncApplication.java:42)
            at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$ce897a90.CGLIB$pocket$1(<generated>)
            at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$ce897a90$$FastClassBySpringCGLIB$$27486db9.invoke(<generated>)
            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$$ce897a90.pocket(<generated>)
            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)
            ... 57 common frames omitted
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nl.carosi.remarkablepocket.ArticleValidator': Unsatisfied dependency expressed through constructor parameter 0; nested exception is 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.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
            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.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.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
            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.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)
            ... 40 more
    Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [pl.codeset.pocket.Pocket]: Factory method 'pocket' threw exception; nested exception is java.lang.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
            at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
            at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
            ... 56 more
    Caused by: java.lang.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
            at pl.codeset.pocket.IOUtil.toBytes(IOUtil.java:13)
            at pl.codeset.pocket.HttpClient.lambda$readResponse$0(HttpClient.java:41)
            at java.base/java.util.Optional.orElseGet(Unknown Source)
            at pl.codeset.pocket.HttpClient.readResponse(HttpClient.java:39)
            at pl.codeset.pocket.HttpClient.send(HttpClient.java:25)
            at pl.codeset.pocket.PocketAuthFactory.generateAccessToken(PocketAuthFactory.java:57)
            at pl.codeset.pocket.PocketAuthFactory.createForCode(PocketAuthFactory.java:23)
            at pl.codeset.pocket.PocketAuthFactory.create(PocketAuthFactory.java:40)
            at nl.carosi.remarkablepocket.PocketAuthenticator.authenticate(PocketAuthenticator.java:98)
            at nl.carosi.remarkablepocket.PocketAuthenticator.authAndStore(PocketAuthenticator.java:66)
            at nl.carosi.remarkablepocket.PocketAuthenticator.getAuth(PocketAuthenticator.java:52)
            at nl.carosi.remarkablepocket.SyncApplication.pocket(SyncApplication.java:42)
            at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$ce897a90.CGLIB$pocket$1(<generated>)
            at nl.carosi.remarkablepocket.SyncApplication$$EnhancerBySpringCGLIB$$ce897a90$$FastClassBySpringCGLIB$$27486db9.invoke(<generated>)
            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$$ce897a90.pocket(<generated>)
            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)
            ... 57 more
    
    opened by daguar 4
  • Error on start-up

    Error on start-up

    Following the indicated instructions, just modified to use podman instead of docker: touch ~/.remarkable-pocket ~/.rmapi && mkdir -p ~/.rmapi-cache && podman 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.3.0

    leads to that error at start-up:

    [2022-12-21 10:06:33] 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.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
    [2022-12-21 10:06:33]
    
    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
    [2022-12-21 10:06:33] 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.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[], int, int)" because "is" is null
    	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)
    
    opened by cgueret 3
  • Please use PocketItem.getItemId() to reference Pocket articles.

    Please use PocketItem.getItemId() to reference Pocket articles.

    https://github.com/nov1n/RemarkablePocket/blob/a1aadf2611ee67042d51152f19aeed1e654159fa/src/main/java/nl/carosi/remarkablepocket/PocketService.java#L43

    There are some instances where the Resolved ID is different to the Item ID, and does not work with the call to modify/archive the article. (although the Pocket API still says it worked)

    Many thanks, Tony.

    https://github.com/tchudyk/pocket-integration/blob/4ba9851295197e6199edc0ecb03896d4e74bf7d7/src/main/java/pl/codeset/pocket/read/PocketItem.java#L73

    opened by testingtony 3
  • failed to create a new device token

    failed to create a new device token

    It seems like Remarkable changed something on their side causing new authentication requests to fail. Other projects are also having this problem:

    • https://github.com/jelleschutter/remarkable-firefox/issues/9
    • https://github.com/juruen/rmapi/issues/283

    We'll have to wait for rmapi to fix this issue.

    opened by nov1n 2
  • How to add the command-line arguments, e.g. interval en article limit

    How to add the command-line arguments, e.g. interval en article limit

    Thank you for building this great program. I've managed to sync the first articles to my remarkable after building the container and authenticating the services according to your instructions. However, I'm not sure how to run the container with non-default settings, such as a higher article limit (30) or a larger interval (4 hours). Could you give an example on what i would look like to use these command-line arguments?

    Cheers, Alexander

    opened by b-lex 2
Owner
Robert Carosi
Robert Carosi
Software for Minecraft Pocket Edition 1.1.x forked Nukkit.

Rooti Software for Minecraft Bedrock Edition 1.1.x forked Nukkit. Java 8 installation sudo apt-get update && sudo apt-get install default-jdk sudo apt

null 17 Nov 27, 2022
a program to periodically synchronize the tanzu developer portal profile page with my latest-and-greatest

Tanzu Developer Center Feed Processor 2.0 This is meant to be a logical successor to the original feeds processor. The program pulls in data from the

Developer Advocacy 5 Jul 9, 2022
100+ Spring Boot Articles, Tutorials, Video tutorials, Projects, Guides, Source code examples etc

YouTube Channel - Spring Boot Tutorial Subscribe for future video and updates Spring Boot Tutorial on YouTube Newly published spring boot tutorials (2

Ramesh Fadatare 1.2k Jan 2, 2023
Software for Minecraft Pocket Edition 1.1.x forked Nukkit.

Rooti Software for Minecraft Bedrock Edition 1.1.x forked Nukkit. Java 8 installation sudo apt-get update && sudo apt-get install default-jdk sudo apt

null 17 Nov 27, 2022
a program to periodically synchronize the tanzu developer portal profile page with my latest-and-greatest

Tanzu Developer Center Feed Processor 2.0 This is meant to be a logical successor to the original feeds processor. The program pulls in data from the

Developer Advocacy 5 Jul 9, 2022