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 NoMethodError when generating a uuid using the uuid gem by using SecureRandom instead #6

Closed
wants to merge 2 commits into from

Conversation

iiilx
Copy link

@iiilx iiilx commented Mar 29, 2023

example of the error we were seeing in prod:

NoMethodError: undefined method `unpack' for nil:NilClass
/usr/local/bundle/ruby/2.7.0/gems/uuid-2.3.9/lib/uuid.rb:377:in `read_state': undefined method `unpack' for nil:NilClass (NoMethodError)
	
from /usr/local/bundle/ruby/2.7.0/gems/uuid-2.3.9/lib/uuid.rb:333:in `block in next_sequence'
	
from /usr/local/bundle/ruby/2.7.0/gems/uuid-2.3.9/lib/uuid.rb:367:in `block in open_lock'
	
from /usr/local/bundle/ruby/2.7.0/gems/uuid-2.3.9/lib/uuid.rb:364:in `open'
	
from /usr/local/bundle/ruby/2.7.0/gems/uuid-2.3.9/lib/uuid.rb:364:in `open_lock'
	
from /usr/local/bundle/ruby/2.7.0/gems/uuid-2.3.9/lib/uuid.rb:332:in `next_sequence'
	
from /usr/local/bundle/ruby/2.7.0/gems/uuid-2.3.9/lib/uuid.rb:263:in `initialize'
	
from /usr/local/bundle/ruby/2.7.0/gems/emailage-1.1.0/lib/emailage/client.rb:41:in `new'
	
from /usr/local/bundle/ruby/2.7.0/gems/emailage-1.1.0/lib/emailage/client.rb:41:in `request'
	
from /usr/local/bundle/ruby/2.7.0/gems/emailage-1.1.0/lib/emailage/client.rb:65:in `query'
	
from /app/lib/emailage_verification/client.rb:10:in `query'

maintainers of uuid gem did not address this so people switched to SecureRandom: assaf/uuid#28

@iiilx iiilx closed this Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant