Skip to content
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

Updated to loco 0.11 and fly stopped binding port? #885

Closed
felipesere opened this issue Oct 20, 2024 · 5 comments
Closed

Updated to loco 0.11 and fly stopped binding port? #885

felipesere opened this issue Oct 20, 2024 · 5 comments
Milestone

Comments

@felipesere
Copy link
Contributor

Description

I've updated to loco 0.11 and it seems that my fly.io setup is broken now.

This is the output I see in the logs:

2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]2024-10-20T20:00:00.610823Z  INFO loco_rs::controller::app_routes: +middleware name="static"
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]2024-10-20T20:00:00.610881Z  INFO loco_rs::controller::app_routes: +middleware name="logger"
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]2024-10-20T20:00:00.610896Z  INFO loco_rs::controller::app_routes: +middleware name="request_id"
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]2024-10-20T20:00:00.610922Z  INFO loco_rs::controller::app_routes: +middleware name="powered_by"
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]                      ▄     ▀
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]                                 ▀  ▄
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]                  ▄       ▀     ▄  ▄ ▄▀
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]                                    ▄ ▀▄▄
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]                        ▄     ▀    ▀  ▀▄▀█▄
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]                                          ▀█▄
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄   ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▀▀█
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info] ██████  █████   ███ █████   ███ █████   ███ ▀█
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info] ██████  █████   ███ █████   ▀▀▀ █████   ███ ▄█▄
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info] ██████  █████   ███ █████       █████   ███ ████▄
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info] ██████  █████   ███ █████   ▄▄▄ █████   ███ █████
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info] ██████  █████   ███  ████   ███ █████   ███ ████▀
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]   ▀▀▀██▄ ▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀ ██▀
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]       ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]                https://loco.rs
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]environment: production
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]   database: logging, automigrate
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]     logger: info
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]compilation: release
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]      modes: server
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]listening on https://0.0.0.0:5150
2024-10-20T20:00:00Z app[32873eea1e7918] lhr [info]2024/10/20 20:00:00 INFO SSH listening listen_address=[fdaa:0:a48f:a7b:2808:8572:2afb:2]:22 dns_server=[fdaa::3]:53
2024-10-20T20:00:02Z proxy[32873eea1e7918] lhr [error][PC01] instance refused connection. is your app listening on 0.0.0.0:5150? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)
2024-10-20T20:00:09Z proxy[3d8d313c0d9528] lhr [error][PC01] instance refused connection. is your app listening on 0.0.0.0:5150? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)
2024-10-20T20:00:13Z proxy[32873eea1e7918] lhr [error][PC01] instance refused connection. is your app listening on 0.0.0.0:5150? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)
2024-10-20T20:00:17Z proxy[32873eea1e7918] lhr [error][PR04] could not find a good candidate within 21 attempts at load balancing

Clearly the server starts listening to 0.0.0.0:5150 but ot seems like fly can't get any answer from it?

This is my fly.toml

app = 'foody-v2'
primary_region = 'lhr'

kill_signal = "SIGINT"
kill_timeout = 5

[build]

[env]
LOCO_ENV = "production"

[http_service]
internal_port = 5150
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
processes = ['app']

[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1

[experimental]
entrypoint = ["/usr/app/foody-cli", "start", "--binding", "0.0.0.0"]

am I missing anything?

@felipesere
Copy link
Contributor Author

felipesere commented Oct 20, 2024

I think the jump is technically from a loco 0.6.2 all the way to 0.11 as 0.10 failed on me...

@felipesere
Copy link
Contributor Author

felipesere/foody-rs@2cbb2a2

this commit ended up fixing my app. I wonder if there is some intermingling between passing --binding to loco as a flag vs passing it as a config value?

@jondot
Copy link
Contributor

jondot commented Oct 22, 2024

Per

loco/src/cli.rs

Line 484 in 6d59f68

binding: binding

We've added the -b flag which overrides (from the CLI) the binding config in the config file.
Does that make sense?

@merlinvn
Copy link

I just spend couple hours fixing it. In order to make binding work in production, I have to have binding in the production config file. And -b from the CLI does not help when there is no binding section in config file. And also by default binding setting is not in the example development and test config. Should there be some document about it? Thanks.

@jondot jondot added this to the 0.13.1 milestone Nov 20, 2024
@jondot
Copy link
Contributor

jondot commented Nov 22, 2024

thanks all, this should be fixed in #1007

@jondot jondot closed this as completed Nov 22, 2024
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

No branches or pull requests

3 participants