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

RangeError ERR_OUT_OF_RANGE #214

Open
nsantini opened this issue Apr 12, 2022 · 4 comments
Open

RangeError ERR_OUT_OF_RANGE #214

nsantini opened this issue Apr 12, 2022 · 4 comments

Comments

@nsantini
Copy link

I keep getting these errors but I can't figure out what SSB call is triggering it. Might be from a plugin running in the background...

internal/buffer.js:83
  throw new ERR_OUT_OF_RANGE(type || 'offset',
  ^

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 5. Received 22
    at boundsError (internal/buffer.js:83:9)
    at Buffer.readUInt32LE (internal/buffer.js:217:5)
    at safeReadUint32 (/Users/nicolassantini/Workspace/perihelion/node_modules/jitdb/index.js:384:18)
    at matchAgainstPrefix (/Users/nicolassantini/Workspace/perihelion/node_modules/jitdb/index.js:856:9)
    at /Users/nicolassantini/Workspace/perihelion/node_modules/jitdb/index.js:984:11
    at ensureIndexSync (/Users/nicolassantini/Workspace/perihelion/node_modules/jitdb/index.js:802:7)
    at getBitsetForOperation (/Users/nicolassantini/Workspace/perihelion/node_modules/jitdb/index.js:983:9)
    at getBitsetForOperation (/Users/nicolassantini/Workspace/perihelion/node_modules/jitdb/index.js:1012:7)
    at getBitsetForOperation (/Users/nicolassantini/Workspace/perihelion/node_modules/jitdb/index.js:1012:7)
    at /Users/nicolassantini/Workspace/perihelion/node_modules/jitdb/index.js:1013:9 {
  code: 'ERR_OUT_OF_RANGE'
}
@staltz
Copy link
Member

staltz commented Apr 12, 2022

Thanks for the stack trace. First we need more details:

  • Version of ssb-db2 used
  • Version of jitdb used
  • Version of async-append-only-log used

And then it would be helpful if you would tell us what kind of operators you used, because this error stack trace should only happen with a prefix index, so it's one of these:

https://github.com/ssb-ngi-pointer/ssb-db2/blob/a039325205ab1a6bbe31c7cbf1e54390aa088cb6/operators/index.js#L64

Given that your error says 22, it might be this https://github.com/ssb-ngi-pointer/ssb-db2/blob/a039325205ab1a6bbe31c7cbf1e54390aa088cb6/operators/index.js#L65 but what's odd is that it's happening on a field that is only 5 bytes long, which is very odd. It means that the msg.value.author is 5 characters long, which is totally weird.

Which is why it would be helpful to know how you're writing your queries.

@nsantini
Copy link
Author

Hi @staltz , sorry about the delay, I don't seem to have notifications configured for GitHub 😅

Here are the versions:

  • ssb-db2: 3.1.0
  • jitdb: 6.0.0
  • async-append-only-log: 4.1.0

The queries I'm running are pretty basic:

  • ssb.threads.thread({ root: msgId, allowlist: ["post", "blog"] })
  • ssb.db.getIndex("aboutSelf").getProfile(feedId)
  • ssb.db.getIndex("aboutSelf").getProfiles()
  • ssb.threads.private({allowlist: ["post", "blog"]})
  • ssb.threads.publicSummary({ allowlist: ["post", "blog"] })
  • ssb.blobs.get(blobId)

@staltz
Copy link
Member

staltz commented Apr 20, 2022

Thanks. I'm trying to figure out where is the prefix index used. Can you do an ls -la on the db2/indexes folder? That should show us which indexes you're using and which one is a prefix (or prefix map) index, which the stack trace refers to.

@nsantini
Copy link
Author

Here you go

drwxr-xr-x  21 nicolassantini  staff      672 21 Apr 08:21 .
drwxr-xr-x   4 nicolassantini  staff      128 30 Mar 08:14 ..
drwxr-xr-x  11 nicolassantini  staff      352 20 Apr 13:18 aboutSelf
drwxr-xr-x  13 nicolassantini  staff      416 20 Apr 13:18 base
-rw-r--r--   1 nicolassantini  staff       34 21 Apr 08:11 canDecrypt.index
drwxr-xr-x  10 nicolassantini  staff      320 21 Apr 08:11 contacts
drwxr-xr-x  16 nicolassantini  staff      512 20 Apr 13:19 ebt
-rw-r--r--   1 nicolassantini  staff       63 21 Apr 08:11 encrypted.index
drwxr-xr-x  11 nicolassantini  staff      352 20 Apr 13:18 hashtags
drwxr-xr-x  47 nicolassantini  staff     1504 20 Apr 13:44 keys
-rw-r--r--   1 nicolassantini  staff   145360 21 Apr 08:20 meta_.index
-rw-r--r--   1 nicolassantini  staff   144904 20 Apr 13:12 meta_private_true.index
-rw-r--r--   1 nicolassantini  staff  4913156 21 Apr 08:20 seq.index
-rw-r--r--   1 nicolassantini  staff  4913156 21 Apr 08:20 sequence.index
-rw-r--r--   1 nicolassantini  staff  9826296 21 Apr 08:20 timestamp.index
-rw-r--r--   1 nicolassantini  staff  4691612 21 Apr 08:21 value_author.32prefix
-rw-r--r--   1 nicolassantini  staff   197214 21 Apr 08:20 value_content_fork__map.32prefixmap
-rw-r--r--   1 nicolassantini  staff  2742020 21 Apr 08:20 value_content_root__map.32prefixmap
-rw-r--r--   1 nicolassantini  staff   139828 21 Apr 08:20 value_content_type_blog.index
-rw-r--r--   1 nicolassantini  staff   145360 21 Apr 08:20 value_content_type_post.index
-rw-r--r--   1 nicolassantini  staff   145316 20 Apr 13:18 value_content_type_pub.index

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

2 participants