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

Document is already bound to this RedisPersistence instance #90

Closed
hanspagel opened this issue May 4, 2021 · 4 comments
Closed

Document is already bound to this RedisPersistence instance #90

hanspagel opened this issue May 4, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@hanspagel
Copy link
Contributor

  • 2 instances connected with Redis
Error:
[2021-04-22T22:09:08.111Z] New connection to "new-doc" …
[2021-04-22T22:09:08.111Z] Created document "new-doc" …
(node:53740) UnhandledPromiseRejectionWarning: Error: "new-doc" is already bound to this RedisPersistence instance
    at Object.error.create (~/repo/hocuspocus/node_modules/lib0/error.js:12:28)
    at RedisPersistence.bindState (~/repo/hocuspocus/node_modules/y-redis/src/y-redis.js:158:13)
    at Redis.onCreateDocument (file://~/repo/hocuspocus/node_modules/@hocuspocus/extension-redis/src/Redis.ts:45:28)
    at file://~/repo/hocuspocus/node_modules/@hocuspocus/server/src/Hocuspocus.ts:288:74
...

Setup:
extensions: [
    // Log level is not configurable at the moment.
    new Logger(),
    new Redis({
      host: process.env.REDIS_HOST,
      port: process.env.REDIS_PORT,
    }),
    new RocksDB({
      // [required] Path to the directory to store the actual data in
      path: "./database",

      // [optional] Configuration options for theRocksDB adapter, defaults to "{}“
      options: {
      // This option is only a example. See here for a full list:
      // https://www.npmjs.com/package/leveldown#options
        createIfMissing: true,
      },
   }),
],
@hanspagel hanspagel added the bug Something isn't working label May 4, 2021
@jamesopti
Copy link
Collaborator

I debugged this locally and believe I have a simple solution.

This repo is not open for forks, so I manually cloned it and opened a PR to my clone. Happy to update the base of the PR if forks are enabled!

https://github.com/gamma-app/hocuspocus-ueberdosis/pull/1/files#diff-d77a87bababf87a73bdd805021f23aee4b71388e7ff5942d62626858c7bed76f

@hanspagel hanspagel self-assigned this May 10, 2021
@hanspagel
Copy link
Contributor Author

Sorry for the long silence. Good news though! We’ll start to work on a complete overhaul of the Redis extension for hocuspocus together with the creator of Y.js next week. ✌️

And thanks for the PR, I’ll take a look at it!

@bertpareyn
Copy link
Collaborator

We are currently setting up and running into this as well, any chance this could be merged back soon? 🙏

@hanspagel
Copy link
Contributor Author

Thanks @jamesopti! I’ve incorporated your fix and released a new version. 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants