Skip to content

Fix Thor::MalformattedArgumentError: No value provided for option '--port' during Elastic Beanstalk deployment - #543

Merged
cycomachead merged 1 commit into
mainfrom
cycomachead/223-fix-eb-deployment-port-error/1
Aug 6, 2026
Merged

Fix Thor::MalformattedArgumentError: No value provided for option '--port' during Elastic Beanstalk deployment#543
cycomachead merged 1 commit into
mainfrom
cycomachead/223-fix-eb-deployment-port-error/1

Conversation

@cycomachead

Copy link
Copy Markdown
Contributor

General Info

Changes

Removes the root Procfile to fix a deployment failure on Elastic Beanstalk staging. The Procfile contained web: bundle exec rails server -p $PORT, but the Ruby EB platform never sets a PORT environment variable — it binds Puma to a Unix socket instead. This caused Rails to start with a bare --port argument, resulting in Thor::MalformattedArgumentError: No value provided for option '--port'.

Root cause chain:

  1. A prior commit stripped comments from the 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's Procfile.
  2. Once the comments were removed, EB honored the file, $PORT expanded to an empty string, and the web process crashed at boot.

Fix: Delete the Procfile entirely. This restores the known-good behavior: EB generates web: 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 the Gemfile.

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.log showing 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.md explaining:

  • Why there is intentionally no Procfile
  • The Ruby platform's Unix socket binding (vs. the PORT/TCP convention on other platforms)
  • The no-comments restriction in EB Procfile syntax
  • What to keep in mind if a custom Procfile is ever needed in the future

Since the explanatory comments can't live in the Procfile itself (that's what caused this bug), the documentation lives here instead.

Checklist

  • Name of branch corresponds to story

Superconductor Ticket Implementation | App Preview | Guided Review

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>
@cycomachead
cycomachead merged commit b31a167 into main Aug 6, 2026
3 of 15 checks passed
@cycomachead
cycomachead deleted the cycomachead/223-fix-eb-deployment-port-error/1 branch August 6, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant