We've moved discussions to Discord

NoMethodError for class:ConnectedAccount [SOLVED]

Dan Weaver β€’
The application encountered the following error: undefined method `unpack1' for nil:NilClass (NoMethodError)
/home/deploy/.rbenv/versions/2.6.3/lib/ruby/2.6.0/base64.rb:59:in `decode64'
/home/deploy/Klippr/releases/20190814030557/app/models/user/connected_account.rb:37:in `<class:ConnectedAccount>'

Trying to set up a simple Jumpstart Pro-based app on Hatchbox.io and seeing this error when accessing the site. Same app is running fine in dev.

Anyone else seen/solved this?

Dan Weaver β€’
The line triggering the error is:
attr_encrypted :access_token, key: Base64.decode64(Rails.application.credentials.access_token_encryption_key)
so it seems to be related to missing credentials.

I'm new to the whole Rails credentials thing - my main Rails app is still 3.2.14 and using Figaro for keys, retro πŸ˜‰ - so I created a production.yml.enc file to see if that fixed the issue. Redeployed but still getting the same error.
Dan Weaver β€’
OK, doink! I hadn't added the RAILS_MASTER_KEY environment variable.

Told you I was new to these fancy credentials πŸ˜‚
Bryce Telfer β€’
Thanks for posting this Dan,Β  this helped me too!
Jason Eastwood β€’
Thanks!
dark8a β€’
Thanks!
Brian Carpenter β€’
helpful, thanks.
Chris Oliver β€’
This will be removed in the Rails 7 update as we're moving everything to the built-in encryption. πŸ’ͺ
Dan Weaver β€’
The application encountered the following error: undefined method `unpack1' for nil:NilClass (NoMethodError)
/home/deploy/.rbenv/versions/2.6.3/lib/ruby/2.6.0/base64.rb:59:in `decode64'
/home/deploy/Klippr/releases/20190814030557/app/models/user/connected_account.rb:37:in `<class:ConnectedAccount>'

Trying to set up a simple Jumpstart Pro-based app on Hatchbox.io and seeing this error when accessing the site. Same app is running fine in dev.

Anyone else seen/solved this?

Dan Weaver β€’
The line triggering the error is:
attr_encrypted :access_token, key: Base64.decode64(Rails.application.credentials.access_token_encryption_key)
so it seems to be related to missing credentials.

I'm new to the whole Rails credentials thing - my main Rails app is still 3.2.14 and using Figaro for keys, retro πŸ˜‰ - so I created a production.yml.enc file to see if that fixed the issue. Redeployed but still getting the same error.
Dan Weaver β€’
OK, doink! I hadn't added the RAILS_MASTER_KEY environment variable.

Told you I was new to these fancy credentials πŸ˜‚
Bryce Telfer β€’
Thanks for posting this Dan,Β  this helped me too!
Jason Eastwood β€’
Thanks!
dark8a β€’
Thanks!
Brian Carpenter β€’
helpful, thanks.
Chris Oliver β€’
This will be removed in the Rails 7 update as we're moving everything to the built-in encryption. πŸ’ͺ
Notifications
You’re not receiving notifications from this thread.
Β© 2022 Jumpstart Pro by GoRails, LLC