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

fix: clear queue endpoint error with redis script #11037

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

yitsushi
Copy link
Contributor

Error message:

ReplyError: ERR value is not an integer or out of range script: 720d973b3877f92b4fb3285ced83c97cdd204979, on @user_script:209.

The whole error can be tracked back to one of the arguments, which is Infinity in the codebase, but it has to be a number.

The documentation in bullmq says 0 is unlimited1, and bullmq tries to parse the argument with tonumber which returns with -9223372036854775808 if the argument is "Infinity" which is out of bound.

127.0.0.1:6379> eval 'return tonumber(ARGV[3])' '2' 'slippy.xyz:queue:inbox:inbox:delayed' 'slippy.xyz:queue:inbox:inbox:events' 'slippy.xyz:queue:inbox:inbox:' '1687183763944' Infinity 'delayed'
(integer) -9223372036854775808
127.0.0.1:6379>

Footnotes

  1. https://github.com/taskforcesh/bullmq/blob/master/src/commands/cleanJobsInSet-2.lua#L10

Error message:
```
ReplyError: ERR value is not an integer or out of range script: 720d973b3877f92b4fb3285ced83c97cdd204979, on @user_script:209.
```

The whole error can be tracked back to one of the arguments, which is
`Infinity` in the codebase, but it has to be a number.

The documentation in bullmq says `0` is unlimited[^1], and bullmq tries to
parse the argument with `tonumber` which returns with `-9223372036854775808` if
the argument is `"Infinity"` which is out of bound.

```
127.0.0.1:6379> eval 'return tonumber(ARGV[3])' '2' 'slippy.xyz:queue:inbox:inbox:delayed' 'slippy.xyz:queue:inbox:inbox:events' 'slippy.xyz:queue:inbox:inbox:' '1687183763944' Infinity 'delayed'
(integer) -9223372036854775808
127.0.0.1:6379>
```

[^1]: https://github.com/taskforcesh/bullmq/blob/master/src/commands/cleanJobsInSet-2.lua#L10

Signed-off-by: Efertone <[email protected]>
@github-actions github-actions bot added the packages/backend Server side specific issue/PR label Jun 19, 2023
@yitsushi
Copy link
Contributor Author

Full error:

Jun 19 14:28:36 slippy misskey[2327652]: ReplyError: ERR value is not an integer or out of range script: 720d973b3877f92b4fb3285ced83c97cdd204979, on @user_script:209.
Jun 19 14:28:36 slippy misskey[2327652]:     at parseError (/home/misskey/misskey/node_modules/.pnpm/[email protected]/node_modules/redis-parser/lib/parser.js:179:12)
Jun 19 14:28:36 slippy misskey[2327652]:     at parseType (/home/misskey/misskey/node_modules/.pnpm/[email protected]/node_modules/redis-parser/lib/parser.js:302:14) {
Jun 19 14:28:36 slippy misskey[2327652]:   command: {
Jun 19 14:28:36 slippy misskey[2327652]:     name: 'evalsha',
Jun 19 14:28:36 slippy misskey[2327652]:     args: [
Jun 19 14:28:36 slippy misskey[2327652]:       '720d973b3877f92b4fb3285ced83c97cdd204979',
Jun 19 14:28:36 slippy misskey[2327652]:       '2',
Jun 19 14:28:36 slippy misskey[2327652]:       'slippy.xyz:queue:deliver:deliver:delayed',
Jun 19 14:28:36 slippy misskey[2327652]:       'slippy.xyz:queue:deliver:deliver:events',
Jun 19 14:28:36 slippy misskey[2327652]:       'slippy.xyz:queue:deliver:deliver:',
Jun 19 14:28:36 slippy misskey[2327652]:       '1687184916013',
Jun 19 14:28:36 slippy misskey[2327652]:       'Infinity',
Jun 19 14:28:36 slippy misskey[2327652]:       'delayed'
Jun 19 14:28:36 slippy misskey[2327652]:     ]
Jun 19 14:28:36 slippy misskey[2327652]:   }

(and repeat the same with the full lua script in the output)

@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Merging #11037 (8250353) into develop (8c7bcdf) will decrease coverage by 0.16%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop   #11037      +/-   ##
===========================================
- Coverage    77.47%   77.32%   -0.16%     
===========================================
  Files          909      737     -172     
  Lines        91516    70031   -21485     
  Branches      6891     6393     -498     
===========================================
- Hits         70906    54149   -16757     
+ Misses       20610    15882    -4728     
Impacted Files Coverage Δ
packages/backend/src/core/QueueService.ts 48.29% <0.00%> (ø)

... and 173 files with indirect coverage changes

@syuilo syuilo merged commit e2261b6 into misskey-dev:develop Jun 22, 2023
@syuilo
Copy link
Member

syuilo commented Jun 22, 2023

🙏

@yitsushi yitsushi deleted the clear-queue branch June 22, 2023 08:54
yu256 pushed a commit to yu256/akatsukey that referenced this pull request Jul 16, 2023
Error message:
```
ReplyError: ERR value is not an integer or out of range script: 720d973b3877f92b4fb3285ced83c97cdd204979, on @user_script:209.
```

The whole error can be tracked back to one of the arguments, which is
`Infinity` in the codebase, but it has to be a number.

The documentation in bullmq says `0` is unlimited[^1], and bullmq tries to
parse the argument with `tonumber` which returns with `-9223372036854775808` if
the argument is `"Infinity"` which is out of bound.

```
127.0.0.1:6379> eval 'return tonumber(ARGV[3])' '2' 'slippy.xyz:queue:inbox:inbox:delayed' 'slippy.xyz:queue:inbox:inbox:events' 'slippy.xyz:queue:inbox:inbox:' '1687183763944' Infinity 'delayed'
(integer) -9223372036854775808
127.0.0.1:6379>
```

[^1]: https://github.com/taskforcesh/bullmq/blob/master/src/commands/cleanJobsInSet-2.lua#L10

Signed-off-by: Efertone <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants