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

Invalid base64 when viewing dead job #6241

Closed
pbstriker38 opened this issue Mar 23, 2024 · 5 comments
Closed

Invalid base64 when viewing dead job #6241

pbstriker38 opened this issue Mar 23, 2024 · 5 comments

Comments

@pbstriker38
Copy link

Ruby version: 3.2.3
Rails version: 7.1.3.2
Sidekiq / Pro / Enterprise version(s):
sidekiq 7.2.2
sidekiq-pro 7.2.0

image

<internal:pack> in unpack1 at line 29
sidekiq (7.2.2) lib/sidekiq/api.rb in uncompress_backtrace at line 493
sidekiq (7.2.2) lib/sidekiq/api.rb in error_backtrace at line 442
sidekiq (7.2.2) lib/sidekiq/web/action.rb in _erb_dead at line 65
sidekiq (7.2.2) lib/sidekiq/web/action.rb in _erb at line 89
sidekiq (7.2.2) lib/sidekiq/web/action.rb in erb at line 58
sidekiq (7.2.2) lib/sidekiq/web/application.rb in block in <class:WebApplication> at line 172
sidekiq (7.2.2) lib/sidekiq/web/application.rb in instance_exec at line 404
sidekiq (7.2.2) lib/sidekiq/web/application.rb in block in call at line 404
sidekiq (7.2.2) lib/sidekiq/web/application.rb in catch at line 402
sidekiq (7.2.2) lib/sidekiq/web/application.rb in call at line 402
sidekiq (7.2.2) lib/sidekiq/web/csrf_protection.rb in admit at line 51
sidekiq (7.2.2) lib/sidekiq/web/csrf_protection.rb in call at line 40
rack (3.0.9.1) lib/rack/static.rb in call at line 161
rack (3.0.9.1) lib/rack/builder.rb in call at line 264
sidekiq (7.2.2) lib/sidekiq/web.rb in call at line 117
sidekiq (7.2.2) lib/sidekiq/web.rb in call at line 122
@mperham
Copy link
Collaborator

mperham commented Mar 24, 2024

I’ve never seen this. I suspect we’ll need to see the actual job payload to diagnose.

@pbstriker38
Copy link
Author

These are the job args.

108949587, 43342709, 521298525, 2778

@pbstriker38
Copy link
Author

Tracked it down. This is due to this change.

8506d94

This is the backtrace that was created before the change and can no longer be read by the new code.

"eJwdy00OwiAQBtCrGDZujERjXPQqxoxQPmV0WugM2Ov78/bv4kKt/lmi+Qe3\n3KNX1B6FLVPtIqRYOqzRmjGTtdBAEWOZYDRKMST65r3G4XgeeN7cKvRedNq6\
nnROO3jjhxQtNnJJgDQpv0DfUr7mkPs/cfvlw+ucxiGzd9QPLSDft\n"

@mperham
Copy link
Collaborator

mperham commented Mar 25, 2024

Looks like we should have used m rather than m0 as the unpack directive?

https://github.com/ruby/base64/blob/9669a7d3b0e3b9a739969404daf58f912c58c6b3/lib/base64.rb#L242

@Earlopain
Copy link
Contributor

It was using lax encoding/decoding previously, I changed it to strict on request.

It may be safe to simply switch back to that: while a lax encoded string raises on strict decoding, the opposite direction works just fine:

Base64.decode64(Base64.strict_encode64("abc"))
# => "abc"

Base64.strict_decode64(Base64.encode64("abc"))
# => <internal:pack>:29:in `unpack1': invalid base64 (ArgumentError)

I however haven't tested this further than the above example.

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

3 participants