-
Notifications
You must be signed in to change notification settings - Fork 3
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
Sporadic exception when using this gem #2
Comments
I've spent more time trying to debug this. I normally run my development environment within a simple Docker setup in my Mac. When I try running my app with this gem outside of Docker, then I don't get this exception. I have not been able to isolate any difference between the two which would explain it. I'll paste my Docker setup below in case you'd like to examine it. In addition, when I am running my app within Docker, I get this exception the first time it attempts to send a turbo stream response. All subsequent times there is no exception, but there also is no successful streaming. If I kill the app and restart it, then I again get this exception on the first attempt and all subsequent attempts fail silently. My Dockerfile
And my docker-compose
|
I have worked around my issue. It has something to do with how secret_key_base is being determined. I was using secret_key_base from my credentials.enc file. When I deleted that file and switched to using it from SECRET_KEY_BASE then things worked fine. My hunch is that I don't know enough but I'll leave this issue here for you in case it's helpful. I won't investigate any further since I've worked around the issue. Feel free to close the issue since it's probably not important for you to get to the bottom of it. And BTW, I greatly appreciate you creating this gem and sharing it. It's a big help for the project I'm working on and I don't know how long it will take for rails itself to work around this issue. Thank you! |
Hello! |
It had something to do with a discrepancy between these two values:
Rails.application.secret_key_base
Rails.application.credentials.config[:secret_key_base]
I added debugging at the line that was throwing the exception and these two
values were different, and I don’t think they are ever supposed to be. And
it looks like your code was reading from application rather than
credentials.
I wiped my whole app setup, deleted my credentials file, and set SECRET KEY
BASE in the environment instead and then those values matched.
This had never impacted any other aspect of my setup and I don’t fully
understand rails encryption. But that’s the best clue I have. Sorry I don’t
have a full fix!
…On Tue, May 7, 2024 at 12:22 PM lachappers ***@***.***> wrote:
I have worked around my issue. It has something to do with how
secret_key_base is being determined. I was using secret_key_base from my
credentials.enc file. When I deleted that file and switched to using it
from SECRET_KEY_BASE then things worked fine.
My hunch is that enhanced_postgresql.rb is reading
Rails.application.secret_key_base rather than
Rails.application.credentials.config[:secret_key_base]? When I added some
debugging I noticed those were returning different values and I believe
it's the one from credentials that I need to be using. But again, this was
only an issue within my Docker and not when I do bin/dev.
I don't know enough but I'll leave this issue here for you in case it's
helpful. I won't investigate any further since I've worked around the
issue. Feel free to close the issue since it's probably not important for
you to get to the bottom of it.
And BTW, I greatly appreciate you creating this gem and sharing it. It's a
big help for the project I'm working on and I don't know how long it will
take for rails itself to work around this issue. Thank you!
Hello!
How did you work around this? Is it something to do with setting
payload_encryptor_secret in solid_queue.yml?
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAIR5KDPI6FUUTOOZELVIDZBEEUTAVCNFSM6AAAAABHHZB5QSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYHE2DKNJZGM>
.
You are receiving this because you authored the thread.Message ID:
<reclaim-the-stack/actioncable-enhanced-postgresql-adapter/issues/2/2098945593
@github.com>
|
I changed my adapter from redis to this gem's
enhanced_postgresql
and tried the app. At first it worked! I was excited but as I'm testing it more I get random failures with this exception:I'm trying to make sense of the source within
enhanced_postgresql.rb
but I don't have any ideas yet as to why this fails occasionally.The text was updated successfully, but these errors were encountered: