Cloudflared error, cannot find config, using provided Docker tutorial

In this Cloudflare tutorial: GitHub - cloudflare/postgres-postgrest-cloudflared-example: Create a PostgreSQL database with a REST API, exposed to the internet securely with Cloudflare Tunnel

The repo has a docker-compose that should create a quick tunnel and start serving PostgreSQL via a PostgREST api on port 3000 from within the docker and not need anything from the local file system, or need any authentication for the tunnel.

When doing docker-compose up

The tunnel is created, the database comes up and is ready to accept connections, but cloudflared gives errors about default configuration path:

docker-compose up 
Starting postgres-postgrest-cloudflare-docker_postgres_1 ... done
Starting postgres-postgrest-cloudflare-docker_postgrest_1 ... done
Starting postgres-postgrest-cloudflare-docker_cloudflared_1 ... done
Attaching to postgres-postgrest-cloudflare-docker_postgres_1, postgres-postgrest-cloudflare-docker_postgrest_1, postgres-postgrest-cloudflare-docker_cloudflared_1
postgres_1     | 
postgres_1     | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres_1     | 
postgres_1     | 2022-06-01 16:23:00.162 UTC [1] LOG:  starting PostgreSQL 14.0 (Debian 14.0-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
postgres_1     | 2022-06-01 16:23:00.172 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres_1     | 2022-06-01 16:23:00.172 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres_1     | 2022-06-01 16:23:00.175 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1     | 2022-06-01 16:23:00.179 UTC [27] LOG:  database system was shut down at 2022-06-01 16:22:56 UTC
postgrest_1    | 01/Jun/2022:16:23:00 +0000: Attempting to connect to the database...
postgrest_1    | 01/Jun/2022:16:23:00 +0000: Listening on port 3000
postgrest_1    | 01/Jun/2022:16:23:00 +0000: Connection successful
postgrest_1    | 01/Jun/2022:16:23:00 +0000: Config re-loaded
postgres_1     | 2022-06-01 16:23:00.185 UTC [1] LOG:  database system is ready to accept connections
postgrest_1    | 01/Jun/2022:16:23:00 +0000: Listening for notifications on the pgrst channel
postgrest_1    | 01/Jun/2022:16:23:00 +0000: Schema cache loaded
cloudflared_1  | 2022-06-01T16:23:01Z INF Thank you for trying Cloudflare Tunnel. Doing so, without a Cloudflare account, is a quick way to experiment and try it out. However, be aware that these account-less Tunnels have no uptime guarantee. If you intend to use Tunnels in production you should use a pre-created named tunnel by following: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps
cloudflared_1  | 2022-06-01T16:23:01Z INF Requesting new quick Tunnel on trycloudflare.com...
cloudflared_1  | 2022-06-01T16:23:03Z INF +--------------------------------------------------------------------------------------------+
cloudflared_1  | 2022-06-01T16:23:03Z INF |  Your quick Tunnel has been created! Visit it at (it may take some time to be reachable):  |
cloudflared_1  | 2022-06-01T16:23:03Z INF |  https://infants-mostly-bhutan-fairly.trycloudflare.com                                    |
cloudflared_1  | 2022-06-01T16:23:03Z INF +--------------------------------------------------------------------------------------------+
cloudflared_1  | 2022-06-01T16:23:03Z INF Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /etc/cloudflared /usr/local/etc/cloudflared]
cloudflared_1  | 2022-06-01T16:23:03Z INF Version 2022.5.1
cloudflared_1  | 2022-06-01T16:23:03Z INF GOOS: linux, GOVersion: go1.17.1, GoArch: amd64
cloudflared_1  | 2022-06-01T16:23:03Z INF Settings: map[no-autoupdate:true protocol:quic]
cloudflared_1  | 2022-06-01T16:23:03Z INF Environmental variables map[TUNNEL_URL:http://postgrest:3000]
cloudflared_1  | 2022-06-01T16:23:03Z INF Generated Connector ID: b4b1de74-496e-40fa-bca9-d94518df8ec9
cloudflared_1  | 2022-06-01T16:23:03Z INF Initial protocol quic
cloudflared_1  | 2022-06-01T16:23:03Z INF Starting metrics server on 127.0.0.1:44723/metrics
cloudflared_1  | 2022/06/01 16:23:03 failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.
cloudflared_1  | 2022-06-01T16:23:03Z ERR Failed to serve quic connection error="Unauthorized: Failed to get tunnel" connIndex=0
cloudflared_1  | 2022-06-01T16:23:03Z ERR Register tunnel error from server side error="Unauthorized: Failed to get tunnel" connIndex=0
cloudflared_1  | 2022-06-01T16:23:03Z INF Retrying connection in up to 2s seconds connIndex=0
cloudflared_1  | 2022-06-01T16:23:03Z WRN Your version 2022.5.1 is outdated. We recommend upgrading it to 2022.5.3
cloudflared_1  | 2022-06-01T16:23:04Z ERR Failed to serve quic connection error="Unauthorized: Failed to get tunnel" connIndex=0
cloudflared_1  | 2022-06-01T16:23:04Z ERR Register tunnel error from server side error="Unauthorized: Failed to get tunnel" connIndex=0
cloudflared_1  | 2022-06-01T16:23:04Z INF Retrying connection in up to 4s seconds connIndex=0
cloudflared_1  | 2022-06-01T16:23:07Z ERR Failed to serve quic connection error="Unauthorized: Failed to get tunnel" connIndex=0
cloudflared_1  | 2022-06-01T16:23:07Z ERR Register tunnel error from server side error="Unauthorized: Failed to get tunnel" connIndex=0
cloudflared_1  | 2022-06-01T16:23:07Z INF Retrying connection in up to 8s seconds connIndex=0
cloudflared_1  | 2022-06-01T16:23:12Z INF Connection c206cf44-945f-4c3c-a85c-af60c6338dc2 registered connIndex=0 location=ORD
cloudflared_1  | 2022-06-01T16:23:12Z INF Connection 5e91c8d5-256d-4e45-959e-70fe419f4fc6 registered connIndex=1 location=EWR
cloudflared_1  | 2022-06-01T16:23:13Z INF Connection f0f1c502-3e73-460b-9cf8-b921bb6c964b registered connIndex=2 location=ORD
cloudflared_1  | 2022-06-01T16:23:14Z INF Connection 0e5d1cc4-4493-4a5e-97a8-d5c844f9788d registered connIndex=3 location=EWR

If you are using the plain docker-compose file then there is no config and you will get a random tunnel each time.

You can also config the tunnel and it will stay the same.

Yes, it creates a random tunnel, and it works

The endpoint of the tunnel does not connect though, so I should be able to go to the domain and use the endpoint, but it cannot connect to the tunnel endpoint. The error message is listed above.

What errors are you seeing when you try to connect to the tunnel endpoint? The docker logs show that all 3 services came up, and the cloudflared one took a few goes to establish a connection.

You are right - Thanks!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.