Hi, all, thanks in advance for any help.
I am broadening my horizons, database-wise and using Cassandra for an app I’m working on. The database uses a pretty simple Dockerfile
FROM cassandra:5
COPY ./cassandra.yaml /etc/cassandra/cassandra.yaml
EXPOSE 9042
CMD ["cassandra", "-f"]
With the fly.toml matching the expected port
[http_service]
internal_port = 9042
force_https = true
#auto_stop_machines = 'stop'
auto_stop_machines = false
auto_start_machines = true
min_machines_running = 0
processes = ['app']
Sure enough when I fly ssh console into my app I can do an nslookup and see
root@2867555c443268:/# nslookup <cass-app-name>.flycast
Server: fdaa::3
Address: fdaa::3#53
Name: <cass-app-name>.flycast
Address: fdaa:3d:df18:0:1::2
Going from there to the Cassandra console confirms the IP address
root@2867555c443268:/# cqlsh -u *** -p ***
Warning: Using a password on the command line interface can be insecure.
Recommendation: use the credentials file to securely provide the password.
Connected to <cluster> at 127.0.0.1:9042
[cqlsh 6.2.0 | Cassandra 5.0.6 | CQL spec 3.4.7 | Native protocol v5]
Use HELP for help.
This should confirm that the URL I give Flyway would be jdbc:cassandra://<cass-app-name.flycast:9042?localdatacenter=datacenter1, based on the URL when running in local Docker being jdbc:cassandra://<cass-container-name>:9042?localdatacenter=datacenter1, however what I’m seeing
Caused by: org.flywaydb.core.internal.exception.sqlExceptions.FlywaySqlUnableToConnectToDbException: Unable to obtain connection from database (jdbc:cassandra://<cass-app-name.flycast:9042?localdatacenter=datacenter1) for user 'cassandra': com.datastax.oss.driver.api.core.AllNodesFailedException: Could not reach any contact point, make sure you've provided valid addresses (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=<cass-app-name>.flycast/<unresolved>:9042, hostId=null, hashCode=39591661): [com.datastax.oss.driver.api.core.connection.ConnectionInitException: [s0|control|id: 0x57753412, L:/[fdaa:3d:df18:a7b:616:252e:bd09:2]:52296 - R:<cass-app-name>.flycast/[fdaa:3d:df18:0:1:0:0:2]:9042] Protocol initialization request, step 1 (OPTIONS): unexpected failure (com.datastax.oss.driver.api.core.connection.ClosedConnectionException: Unexpected error on channel)]
As we can see the host IP address is being resolved correctly, so I feel confident ruling out that I typo’d a URL somewhere. I know Cassandra is running. As it looks like both ends are working as intended the problem must be that I have something configured incorrectly in the fly.io internal networking, possibly with the port not being exposed correctly? Would appreciate any input on what might have gone wrong.