mirror of
https://github.com/hibiken/asynqmon.git
synced 2026-04-26 17:45:50 +03:00
[GH-ISSUE #210] [BUG] redis eval error: "this Redis command is not allowed from scripts" #400
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynqmon#400
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @momentumtools on GitHub (Jan 27, 2022).
Original GitHub issue: https://github.com/hibiken/asynqmon/issues/210
Hi,
locally the asynqmon works perfectly, however now that I just deployed it to my heroku setup (using a redis enterprise cloud instance the chrome console log returns these errors:
I googled a bit and this is most likely due to the REDIS server being relatively strict.
Any idea how to circumvent this through an asynqmon configuration (because on the redis enterprise cloud I don't see any EVAL related configurations)
Greetings,
PJ
PS: love your queuing tool and have been in the game for quite some time now :)!
@hibiken commented on GitHub (Jan 28, 2022):
@momentumtools Thank you for opening this issue!
Would you mind providing additional info?
@momentumtools commented on GitHub (Jan 28, 2022):
Hi @hibiken ,
thanks for the quick reply, here are the parameters
PS: the support folks at redis enterprise ask me the specific LUA script that we are trying to execute to help me figure out which command it is that is blocked on my DB
@hibiken commented on GitHub (Jan 28, 2022):
Thanks!
I haven't confirmed it on my side, but my first guess is this MEMORY USAGE command we are calling in this Lua script . Specifically these two lines
github.com/hibiken/asynq@dff2e3a336/internal/rdb/inspect.go (L236)github.com/hibiken/asynq@dff2e3a336/internal/rdb/inspect.go (L253)I need to do a bit more research but my initial thought is that the issue is due to the restriction around non-deterministic commands in script; non-deterministic commands are not allowed in Lua script when replication is enabled. As documented in https://redis.io/commands/eval, we may want to disable replication when calling MEMORY USAGE from that script (https://redis.io/commands/eval#selective-replication-of-commands) Or use read-only EVAL command instead (this EVAL_RO is only supported from redis v7+ though, so maybe not realistic to use this). I will look into this issue in the next few days but if you have any updates, please let me know in this thread :)
@hibiken commented on GitHub (Jan 29, 2022):
Actually I take that back, since the redis version is above v4 in this case, script effect replication is used and since the Lua script is read-only, it should be allowed. Not sure where this error is coming from. Let me know if you hear back from the support team.
@momentumtools commented on GitHub (Jan 29, 2022):
Hi @hibiken , thanks again for such fast support. I'm amazed :)!
I've forwarded
github.com/hibiken/asynq@dff2e3a336/internal/rdb/inspect.go (L225-L266)to the redis enterprise support, maybe it will ring a bell for them.Is there a way for us to be surer which LUA script is triggering the error? a kind of debug mode to enable?
@hibiken commented on GitHub (Jan 30, 2022):
This is a good opportunity to find a bug so thank you for providing the info!
There's no debug mode to quickly figure out the problematic lua script unfortunately, but based on the fact that the error is returned when we make API calls to
/api/queuesendpoint, it tells me that this handler is causing the error. And if you look at the handler definition, it's most likely this call toinspector.GetQueueInfois a culprit, which in turn calls thisCurrentStatand this function executes two lua scripts this one and this one.@momentumtools commented on GitHub (Jan 31, 2022):
Hi @hibiken , I'll pass the first script to the redis enterprise support team as well, as I only pasted them the 2nd one you thought the error was in when you wrote https://github.com/hibiken/asynqmon/issues/210#issuecomment-1024754563
@hibiken commented on GitHub (Feb 8, 2022):
@momentumtools Any update on this?
@momentumtools commented on GitHub (Feb 8, 2022):
Nope, redis enterprise support is dead silent...
most likely I'll try with another redis provider and see if the same error occurs, if not it's redis enterprise their loss sadly...
Long story short, this EVAL error did not pop up yet with any other users, right?
@momentumtools commented on GitHub (Feb 17, 2022):
@hibiken ok I got back from their support
I'll thus have to pick another redis provider, but so now when other people bump into this they'll know where to look ;)
@hibiken commented on GitHub (Feb 18, 2022):
@momentumtools Thank you for the update! Switching to another redis provider sounds like a non-trivial change, especially for some tooling issues. Maybe we should support turning off memory usage command in the script via a flag; For example, we could add a flag
--disable_memory_usage_commandto this Web UI binary. Let me know what you think!@Soul-Killer-Ky commented on GitHub (Apr 16, 2024):
In the api/queues interface, eval will be called twice and an error will be reported the second time
@Soul-Killer-Ky commented on GitHub (Apr 16, 2024):
I rewrote the eval of redisClient, so I can print the logs
@brummetj commented on GitHub (May 6, 2024):
hey @hibiken how easy can you get that flag in to disable the check? Im running asynqmon on AWS with elastic cache and getting
@unix2dos commented on GitHub (Aug 22, 2024):
@hibiken can this flag be added?