Cloudflared Tunnel Connection Issues

I’m trying to setup the cloudlfared postgrest tunnel for the tutorial “Build data-driven applications with workers and PostgreSQL”. When I run my postgrest endpoint I get the following message: {
“hint”: null,
“details”: “Custom parameter names must be two or more simple identifiers separated by dots.”,
“code”: “42602”,
“message”: “invalid configuration parameter name “request.header.user-agent””
}

I checked the cloudflared docker logs and it seems like the cloudflared tunnell connection keeps dropping:
postgres-postgrest-cloudflared-example [main●] % docker logs postgres-postgrest-cloudflared-example_cloudflared_1
2021-10-06T13:51:21Z 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
2021-10-06T13:51:21Z INF Requesting new quick Tunnel on trycloudflare.com
2021-10-06T13:51:24Z INF ±-------------------------------------------------------------------------------------------+
2021-10-06T13:51:24Z INF | Your quick Tunnel has been created! Visit it at (it may take some time to be reachable): |
2021-10-06T13:51:24Z INF | https://ambient-administered-represented-ability.trycloudflare.com |
2021-10-06T13:51:24Z INF ±-------------------------------------------------------------------------------------------+
2021-10-06T13:51:24Z INF Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /etc/cloudflared /usr/local/etc/cloudflared]
2021-10-06T13:51:24Z INF Version 2021.9.2-dev
2021-10-06T13:51:24Z INF GOOS: linux, GOVersion: go1.17.1, GoArch: amd64
2021-10-06T13:51:24Z INF Settings: map[no-autoupdate:true]
2021-10-06T13:51:24Z INF Environmental variables map[TUNNEL_URL:http://postgrest:3000]
2021-10-06T13:51:24Z INF Generated Connector ID: 9a8bf599-61db-45db-bb27-e5ffb002d0bf
2021-10-06T13:51:24Z INF Initial protocol http2
2021-10-06T13:51:24Z INF Starting metrics server on 127.0.0.1:44207/metrics
2021-10-06T13:51:24Z ERR Register tunnel error from server side error=“Unauthorized: Record for tunnel not found” connIndex=0
2021-10-06T13:51:25Z INF Retrying connection in up to 2s seconds connIndex=0
2021-10-06T13:51:26Z ERR Register tunnel error from server side error=“Unauthorized: Record for tunnel not found” connIndex=0
2021-10-06T13:51:26Z INF Retrying connection in up to 4s seconds connIndex=0
2021-10-06T13:51:27Z ERR Register tunnel error from server side error=“Unauthorized: Record for tunnel not found” connIndex=0
2021-10-06T13:51:27Z INF Retrying connection in up to 8s seconds connIndex=0
2021-10-06T13:51:28Z INF Connection ed21a184-df19-4360-bea4-a3aa76bfd7c3 registered connIndex=0 location=PHL
2021-10-06T13:51:28Z INF Connection 386fd744-c937-449c-a352-6b10d9738dfa registered connIndex=1 location=IAD
2021-10-06T13:51:29Z INF Connection dcedf1a3-a3e5-4a18-b364-8e270e612140 registered connIndex=2 location=PHL
2021-10-06T13:51:30Z INF Connection d7ddf95e-0593-4fa0-a254-d4973f4f08da registered connIndex=3 location=IAD
2021-10-06T15:26:41Z INF Lost connection with the edge connIndex=2
2021-10-06T15:26:41Z ERR Serve tunnel error error=“connection with edge closed” connIndex=2
2021-10-06T15:26:41Z INF Retrying connection in up to 1s seconds connIndex=2
2021-10-06T15:26:41Z INF Lost connection with the edge connIndex=3
2021-10-06T15:26:41Z ERR Serve tunnel error error=“connection with edge closed” connIndex=3
2021-10-06T15:26:41Z INF Retrying connection in up to 1s seconds connIndex=3
2021-10-06T15:26:41Z INF Unregistered tunnel connection connIndex=0
2021-10-06T15:26:41Z INF Unregistered tunnel connection connIndex=2
2021-10-06T15:26:41Z INF Lost connection with the edge connIndex=0
2021-10-06T15:26:41Z ERR Serve tunnel error error=“connection with edge closed” connIndex=0
2021-10-06T15:26:41Z INF Retrying connection in up to 1s seconds connIndex=0
2021-10-06T15:26:41Z INF Unregistered tunnel connection connIndex=3
2021-10-06T15:26:42Z INF Connection dcedf1a3-a3e5-4a18-b364-8e270e612140 registered connIndex=2 location=PHL
2021-10-06T15:26:42Z INF Connection 05b6353f-a1ef-4b70-9a47-7234eddc7e37 registered connIndex=3 location=IAD
2021-10-06T15:26:43Z INF Connection ed21a184-df19-4360-bea4-a3aa76bfd7c3 registered connIndex=0 location=PHL
2021-10-06T15:26:46Z INF Lost connection with the edge connIndex=1
2021-10-06T15:26:46Z ERR Serve tunnel error error=“connection with edge closed” connIndex=1
2021-10-06T15:26:46Z INF Retrying connection in up to 1s seconds connIndex=1
2021-10-06T15:26:46Z INF Unregistered tunnel connection connIndex=1
2021-10-06T15:26:47Z INF Connection 6e8b6e55-9e22-4f4c-8da1-22417f86f08d registered connIndex=1 location=IAD
2021-10-06T15:53:00Z INF Lost connection with the edge connIndex=2
2021-10-06T15:53:00Z ERR Serve tunnel error error=“connection with edge closed” connIndex=2
2021-10-06T15:53:00Z INF Retrying connection in up to 1s seconds connIndex=2
2021-10-06T15:53:00Z INF Unregistered tunnel connection connIndex=2
2021-10-06T15:58:02Z INF Connection dcedf1a3-a3e5-4a18-b364-8e270e612140 registered connIndex=2 location=PHL
2021-10-06T16:02:05Z INF Lost connection with the edge connIndex=3
2021-10-06T16:02:05Z ERR Serve tunnel error error=“connection with edge closed” connIndex=3
2021-10-06T16:02:05Z INF Unregistered tunnel connection connIndex=3
2021-10-06T16:02:05Z INF Retrying connection in up to 1s seconds connIndex=3
2021-10-06T16:02:05Z INF Unregistered tunnel connection connIndex=1
2021-10-06T16:02:05Z INF Lost connection with the edge connIndex=1
2021-10-06T16:02:05Z ERR Serve tunnel error error=“connection with edge closed” connIndex=1
2021-10-06T16:02:05Z INF Retrying connection in up to 1s seconds connIndex=1
2021-10-06T16:02:06Z INF Lost connection with the edge connIndex=0
2021-10-06T16:02:06Z INF Unregistered tunnel connection connIndex=0
2021-10-06T16:02:06Z ERR Serve tunnel error error=“connection with edge closed” connIndex=0
2021-10-06T16:02:06Z INF Retrying connection in up to 1s seconds connIndex=0
2021-10-06T16:02:06Z INF Connection 27bd1172-459f-489d-9c53-be5e05213877 registered connIndex=3 location=IAD
2021-10-06T16:02:07Z INF Connection e566af0c-5bf2-4933-8a90-e72c02b69b54 registered connIndex=1 location=IAD
2021-10-06T16:02:08Z INF Connection ed21a184-df19-4360-bea4-a3aa76bfd7c3 registered connIndex=0 location=PHL
2021-10-06T16:02:58Z INF Lost connection with the edge connIndex=2
2021-10-06T16:02:58Z ERR Serve tunnel error error=“connection with edge closed” connIndex=2
2021-10-06T16:02:58Z INF Retrying connection in up to 1s seconds connIndex=2
2021-10-06T16:02:58Z INF Unregistered tunnel connection connIndex=2
2021-10-06T16:02:58Z ERR writing finish: http2: stream closed
2021-10-06T16:02:58Z ERR writing release: http2: stream closed
2021-10-06T16:03:00Z INF Connection dcedf1a3-a3e5-4a18-b364-8e270e612140 registered connIndex=2 location=PHL

Do I need to setup a cloudred configuration file? Should the cloudred tunnel setup happen when I run docker-compose?

That’s a lot of reading.

So there’s no direct access? It has to go through Cloudflare tunnel?

Tunnels are free, so I’d first recommend you create a permanent one.

Here’s a long thread with a few nuggets that might help with MySQL connections through a tunnel.

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