Fix Thor::MalformattedArgumentError: No value provided for option '--port' during Elastic Beanstalk deployment - #543
Merged
Conversation
The root Procfile was causing deployment failures because the Ruby platform on Elastic Beanstalk does not set a $PORT environment variable, leading to a Thor::MalformattedArgumentError when Rails attempted to start with an empty --port value. Removing the file allows Elastic Beanstalk to generate its default configuration, which correctly binds Puma to a Unix socket for the platform's nginx proxy. - Deleted Procfile to restore known-good deployment behavior - Added documentation in docs/developers.md explaining EB process requirements, socket binding, and Procfile syntax restrictions Co-authored-by: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
General Info
Changes
Removes the root
Procfileto fix a deployment failure on Elastic Beanstalk staging. TheProcfilecontainedweb: bundle exec rails server -p $PORT, but the Ruby EB platform never sets aPORTenvironment variable — it binds Puma to a Unix socket instead. This caused Rails to start with a bare--portargument, resulting inThor::MalformattedArgumentError: No value provided for option '--port'.Root cause chain:
Procfile, which inadvertently activated it for the first time. EB's Ruby platform does not support#comment lines — a file with comments is silently ignored and EB falls back to its generated default. Every previous successful deploy had been running that generated default, not the repo'sProcfile.$PORTexpanded to an empty string, and the web process crashed at boot.Fix: Delete the
Procfileentirely. This restores the known-good behavior: EB generatesweb: bundle exec puma -C /opt/elasticbeanstalk/config/private/pumaconf.rb, which correctly binds the Unix socket nginx proxies to. Hardcoding that path was avoided since it's a private platform detail that AWS may vary based on theGemfile.Local development is unaffected —
Procfile.dev(used via overmind) is untouched.Testing
This fix cannot be validated locally since it only affects Elastic Beanstalk's process management. Confirmation requires a staging deploy — the signal to watch is
/var/log/web.stdout.logshowing Puma booting successfully rather than the Thor error, and the process listening on/var/run/puma/my_app.sock.Documentation
Added a new Deployment (Elastic Beanstalk) section to
docs/developers.mdexplaining:ProcfilePORT/TCP convention on other platforms)ProcfilesyntaxProcfileis ever needed in the futureSince the explanatory comments can't live in the
Procfileitself (that's what caused this bug), the documentation lives here instead.Checklist
Superconductor Ticket Implementation | App Preview | Guided Review