-
Notifications
You must be signed in to change notification settings - Fork 29
uninitialized constant Rack::RACK_MULTITHREAD #171
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
Comments
Same issue: rails-lambda/lamby-cookiecutter#41 |
any updates? |
downgrading / forcing down rack to 2.2.6.4 clears the issue; but it surely does not work with latest rack (= default installed for a new rails app seems like 3.0.x) |
I experienced the same issue here. |
I experienced this as well. I removed the constants in #173 and it fixed the issue. |
Going to look at this tomorrow and get it merged after testing on lower rack versions to make sure it doesn't break anything. If it does i need to set a rack restraint and it will be a major version change with a breaking change. |
Hi @jeremiahlukus thanks for looking into this and pushing a fix!
Let me know if I'm doing something wrong or if I can provide any additional information. thanks again! |
Seems like more conta were removed https://github.com/rails-lambda/lamby/blob/master/lib/lamby/rack_http.rb#L41 I only tested on older rack versions since my app uses an older rack version. I should have tested on older and newer to verify the PR actually fixes the issue. I should have some time tomorrow to spin up a new app and test. I’ll fix this in the next couple days. More than happy to look over a PR if you want it in faster. |
Thanks @jeremiahlukus |
Im able to reproduce |
lol so looking at the rack changelog https://github.com/rack/rack/blob/main/CHANGELOG.md#added
They added back the Rack::VERSION constant. |
for some reason getting status 0 when using the newest rack version no idea why. |
@thenano can you see if my branch fixes it for you? gem 'lamby', git: 'https://github.com/jeremiahlukus/lamby' |
Ok finally fixed it that took longer than i'd like to admit. Ill send another PR |
Hey @jeremiahlukus thanks so much for looking into this! Sorry about the delay in getting back to you. I have tested your branch and although in the end I'm getting a 500 response, checking lamby logs it all seems to be running fine, so something else might have broken in my setup which I'll look into. Happy to do any more testing if you need. |
it looks like API Gateway is not happy with the response sent from lambda:
Not sure if related, or maybe something that rack has changed? |
Hm i think i need to ensure multiValueHeaders is always a hash. |
@jeremiahlukus I'm still getting the same error, I'm pretty sure it built with the latest from your branch, but if you wanted to add a tag or something like that I could force a version and check? |
I closed the PR still have a weird issue on my end as well. I’m not seeing the error you are seeing however. If you can debug a bit that would be helpful. |
@jeremiahlukus interesting, happy to help with debugging. essentially I keep getting that same error on the GW side. Can you point me in the right direction of where I could potentially dump some information into logs to get more insight into it? |
I'm in this statement too 😅 |
Whats weird is some requests a passing and some are returning status 0 and 302. Having a hard time figuring out if its because of my app or lamby ha |
working on it again today making progress |
@thenano hey I got it working on my app now https://github.com/jeremiahlukus/lamby Can you try again. I realized I was hitting my cloud front app so some things were getting cached when i hit api gateway directly i was able to reproduce consistently. After a good bit of fiddling I finally got it to work with rack v3 (pulling from master). |
Or @metaskills if you have an app running on rack v2 and want to test v3 that would be great. |
Deployed in 3 apps so far no issues, I also tested on a rack v2 app and it seems to be working. |
Hey @jeremiahlukus thanks again for all your work on this.
Let me know if you need any more info or if I need to change anything. Thanks! |
Just to make sure does your app work with the published version using rack v2? and does your app differ from the configuration And are you pre compiling in your deploy script and coping those files in your dockerfile? I also have my app uses active admin and that css and is is loading so either your app is configured wrong or you are loading assets a different way and I’m not accounting for that in my fork of lamby |
Hey @jeremiahlukus yep I can confirm that the application works with rack 2.2.9 and lamby 5.2.1. This is very odd because my application is also an activeadmin application (3.2.2 with rails 7.1.3.4). Here's my full Dockerfile for reference, if it might help:
|
Do you have
In your config? All your gems are update date as well (ie json) It def sounds like something in your app is off, but i could be wrong. Its sending something not UTF-8 as a response. I am now forcing UTF encoding and add some logging can you bundle update lamby from my fork and try again? Maybe something will be in the logs to help. If that doesnt work can you add some middleware in your app and see if that response is off? Something i added in my app to debug things was
|
@jeremiahlukus I added the extra public server config but it didn't change anything. I also made sure all gems were up to date. I updated to your latest branch and the problem actually got worse, and I think I know what the underlying issue is: compression. With your latest, even the index file was failing in the browser due to config.middleware.insert_before Rack::ETag, Rack::Deflater This compresses all content in rails itself, although I don't think it runs for public files. When I removed that line, the app started sending the HTML correctly again.
Hope this helps find a way forward? I think we just need to deal with compressed responses? As an additional note, I had to add the middleware as this: |
AH I found the issue! Rack::Deflater set This should fix your issue. Thanks for the info man I would have missed this one. Can you bundle update lamby from my fork and try again? |
@jeremiahlukus spot on, everything works as expected! |
Awesome! Thanks for debugging with me ha. Ill send another PR to really support rack 3after a bit more testing. |
Will merge this soon going to test a bit more and try to add a bit more to the test suite. |
@thenano hopefully will get the PR merged tomorrow or the next day and then cut a release sometime this week |
@jeremiahlukus thank you so much. |
merged waiting release |
I do that right? |
I just did a commit to main add v6 to the Gemfile.lock. I also just tagged and release v6 to ruby gems. 🥳 Great work team! |
Yes that part is not automated, if you want i could create a workflow for that but you would have to enter your keys in the secrets. Awesome i forgot to bundle install after I upped the version ha. Indeed thank you @thenano for helping debug some issues |
Thank you very much @jeremiahlukus and @metaskills! we've updated to v6 on our side 💪 |
Uh oh!
There was an error while loading. Please reload this page.
Using rails 7.1.1, rack (3.0.8) and lamby (~> 5.2)
Hard to get why those happen; I created a fresh app following the getting started and deploying via github actions. It does deploy without issues, but invariably getting the following error :
Went through the rack code trying to find
Rack::RACK_MULTITHREAD
; not to be foundThen further below :
This one looks related
The text was updated successfully, but these errors were encountered: