Hi,
I’m using LiteFS proxy, and I see a lot of error [PC01] instance refused connection. is your app listening on 0.0.0.0:3000? 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) on my app.
When launching my app, I can see that it’s starting on the right port ([remix-serve] http://localhost:8081)
In my litefs.yml file, I have the following values:
proxy:
# matches the internal_port in fly.toml
addr: ':8080'
target: 'localhost:8081'
db: '${DATABASE_FILENAME}'
What is this error and where does the 3000 come from?
Hi… This would be the internal_port, in fly.toml.
You can get a little more context in the following two recent forum threads:
(Note that the second is not precisely your own situation, but the overall debugging steps, etc., are related.)
LiteFS is a niche database with still a few rough edges, particularly with regard to fly launch auto-configuration.
Basically, you have to roll up your sleeves a fair amount initially…
Thank you for your answer! I had a look at those posts before posting, unfortunately, it didn’t help.
In my fly.toml file, I have those for service:
[[services]]
internal_port = 8080
processes = [ "app" ]
protocol = "tcp"
script_checks = [ ]
which match why I have in litefs.yml:
proxy:
# matches the internal_port in fly.toml
addr: ':8080'
target: 'localhost:8081'
db: '${DATABASE_FILENAME}'
I’m not sure what’s happening, because I can still access my app, but maybe it’s bypassing the proxy?
By running the command on the second post on the machine, I have the following:
Odd… It shouldn’t be possible to bypass the Fly edge proxy, since that’s how requests to app-name.fly.dev reach your Machine in the first place.
The ss output looks correct, as well.
Do the machine IDs in the log match the ones shown in fly m list?
Also, the Fly.io platform as a whole sometimes gets confused by redundant [[services]]/[http_service] blocks. Perhaps you could post your full fly.toml file?
(Feel free to * out any sensitive names.)
I changed my app port to 3000 (while keeping 8080 for internal_process) and the error PC01 is no longer present in my logs
here my full fly.toml file
app = '*'
primary_region = 'cdg'
kill_signal = 'SIGINT'
kill_timeout = 5
swap_size_mb = 512
[experimental]
auto_rollback = true
[mounts]
source = 'data'
destination = '/data'
[[services]]
internal_port = 8080
processes = [ "app" ]
protocol = "tcp"
script_checks = [ ]
[services.concurrency]
hard_limit = 100
soft_limit = 80
type = "requests"
[[services.ports]]
handlers = [ "http" ]
port = 80
force_https = true
[[services.ports]]
handlers = [ "tls", "http" ]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
[[services.http_checks]]
interval = "10s"
grace_period = "5s"
method = "get"
path = "/healthcheck"
protocol = "http"
timeout = "2s"
tls_skip_verify = false
headers = { }
[[services.http_checks]]
grace_period = "10s"
interval = "30s"
method = "GET"
timeout = "5s"
path = "/litefs/health"
[[vm]]
memory = '512mb'
cpu_kind = 'shared'
cpus = 1