Tailscale + mysql, a noob guide

Goal: connect a mysql instance hosted in fly to my tailnet
Obstacle: i dont know about docker files or toml
Error: Deployment is successful but machine start and then crashes. i dont see any error logs in the machine.

Hello world, im stuck trying to connect my app to tailnet

Bash:

#!/bin/sh

/app/tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/var/run/tailscale/tailscaled.sock &
/app/tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname=fly-app
/app/my-app

Docker file:

FROM alpine:latest
WORKDIR /app

# This is where one could build the application code as well.

RUN apk update && \
    apk add --no-cache ca-certificates iptables ip6tables wget && \
    rm -rf /var/cache/apk/*


ENV TSFILE=tailscale_1.72.1_amd64.tgz

RUN wget https://pkgs.tailscale.com/stable/${TSFILE} && \
    tar xzf ${TSFILE} --strip-components=1

RUN mkdir -p /var/run/tailscale /var/cache/tailscale /var/lib/tailscale

# Initialize MariaDB data directory
RUN apk add mysql mysql-client

# Copy start script
COPY start.sh /app/start.sh

RUN chmod +x /app/start.sh

# Run on container startup.
CMD ["/app/start.sh"]

TOML

# fly.toml app configuration file generated for fly-tailscale-mysql on 2024-08-30T15:34:55-07:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'fly-tailscale-mysql'
primary_region = 'lax'

[build]

[env]
MYSQL_DATABASE = 'some_db'
MYSQL_USER = 'non_root_user'

[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[vm]]
cpu_kind = 'shared'
cpus = 1
memory_mb = 2048

2024-08-30T22:37:59.786 runner[3d8dd955a22168] lax [info] machine has reached its max restart count (10)
2024-08-30T22:38:39.193 app[e825d66b7296e8] lax [info] 2024-08-30T22:38:39.193682457 [01J6JPXR0P7EEADCVHMGWAF34Y:main] Running Firecracker v1.7.0
2024-08-30T22:38:39.552 app[e825d66b7296e8] lax [info] [ 0.296708] PCI: Fatal: No config space access function found
2024-08-30T22:38:39.903 app[e825d66b7296e8] lax [info] INFO Starting init (commit: 20f21dc5f)...
2024-08-30T22:38:39.940 app[e825d66b7296e8] lax [info] INFO Preparing to run: `/app/start.sh` as root
2024-08-30T22:38:39.945 app[e825d66b7296e8] lax [info] INFO [fly api proxy] listening at /.fly/api
2024-08-30T22:38:39.948 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:39 INFO SSH listening listen_address=[fdaa:9:4fd:a7b:2be:13c:fb24:2]:22 dns_server=[fdaa::3]:53
2024-08-30T22:38:40.006 runner[e825d66b7296e8] lax [info] Machine started in 875ms
2024-08-30T22:38:40.072 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 logtail started
2024-08-30T22:38:40.072 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 Program starting: v1.72.1-tc02a15244-g5c00d019b, Go 1.22.5: []string{"/app/tailscaled", "--state=/var/lib/tailscale/tailscaled.state", "--socket=/var/run/tailscale/tailscaled.sock"}
2024-08-30T22:38:40.072 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 LogID: 5d32a6b048c857c27ca3fec47b074d821d368eb34555ab12bfa410681183a1b7
2024-08-30T22:38:40.072 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 logpolicy: using system state directory "/var/lib/tailscale"
2024-08-30T22:38:40.072 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 dns: [rc=unknown ret=direct]
2024-08-30T22:38:40.072 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 dns: using "direct" mode
2024-08-30T22:38:40.072 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 dns: using *dns.directManager
2024-08-30T22:38:40.099 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 wgengine.NewUserspaceEngine(tun "tailscale0") ...
2024-08-30T22:38:40.106 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 dns: [rc=unknown ret=direct]
2024-08-30T22:38:40.106 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 dns: using "direct" mode
2024-08-30T22:38:40.107 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 dns: using *dns.directManager
2024-08-30T22:38:40.107 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 link state: interfaces.State{defaultRoute=eth0 ifs={eth0:[172.19.9.58/29 172.19.9.59/29 2605:4c40:104:5acf:0:13c:fb24:1/127 fdaa:9:4fd:a7b:2be:13c:fb24:2/112 llu6]} v4=true v6=true}
2024-08-30T22:38:40.108 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 onPortUpdate(port=53947, network=udp6)
2024-08-30T22:38:40.108 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 router: using firewall mode pref
2024-08-30T22:38:40.108 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 router: default choosing iptables
2024-08-30T22:38:40.115 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 router: netfilter running in iptables mode v6 = true, v6filter = true, v6nat = true
2024-08-30T22:38:40.115 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 onPortUpdate(port=48758, network=udp4)
2024-08-30T22:38:40.115 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 magicsock: disco key = d:20e9e9aef97f954b
2024-08-30T22:38:40.115 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 Creating WireGuard device...
2024-08-30T22:38:40.115 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 Bringing WireGuard device up...
2024-08-30T22:38:40.115 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 Bringing router up...
2024-08-30T22:38:40.115 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 Clearing router settings...
2024-08-30T22:38:40.115 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 Starting network monitor...
2024-08-30T22:38:40.116 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 Engine created.
2024-08-30T22:38:40.118 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 external route: up
2024-08-30T22:38:40.122 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 monitor: [unexpected] network state changed, but stringification didn't: interfaces.State{defaultRoute=eth0 ifs={eth0:[172.19.9.58/29 172.19.9.59/29 2605:4c40:104:5acf:0:13c:fb24:1/127 fdaa:9:4fd:a7b:2be:13c:fb24:2/112 llu6]} v4=true v6=true}
2024-08-30T22:38:40.122 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 monitor: [unexpected] old: {"InterfaceIPs":{"dummy0":null,"eth0":["172.19.9.58/29","172.19.9.59/29","2605:4c40:104:5acf:0:13c:fb24:1/127","fdaa:9:4fd:a7b:2be:13c:fb24:2/112","fe80::dcad:faff:fecc:186d/64"],"lo":["127.0.0.1/8","::1/128"],"teql0":null},"Interface":{"dummy0":{"Index":2,"MTU":1500,"Name":"dummy0","HardwareAddr":"tow0Foa0","Flags":2,"AltAddrs":null,"Desc":""},"eth0":{"Index":3,"MTU":1420,"Name":"eth0","HardwareAddr":"3q36zBht","Flags":51,"AltAddrs":null,"Desc":""},"lo":{"Index":1,"MTU":65536,"Name":"lo","HardwareAddr":null,"Flags":37,"AltAddrs":null,"Desc":""},"teql0":{"Index":4,"MTU":1500,"Name":"teql0","HardwareAddr":null,"Flags":0,"AltAddrs":null,"Desc":""}},"HaveV6":true,"HaveV4":true,"IsExpensive":false,"DefaultRouteInterface":"eth0","HTTPProxy":"","PAC":""}
2024-08-30T22:38:40.122 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 monitor: [unexpected] new: {"InterfaceIPs":{"dummy0":null,"eth0":["172.19.9.58/29","172.19.9.59/29","2605:4c40:104:5acf:0:13c:fb24:1/127","fdaa:9:4fd:a7b:2be:13c:fb24:2/112","fe80::dcad:faff:fecc:186d/64"],"lo":["127.0.0.1/8","::1/128"],"tailscale0":["fe80::4ff0:bd62:803a:c112/64"],"teql0":null},"Interface":{"dummy0":{"Index":2,"MTU":1500,"Name":"dummy0","HardwareAddr":"tow0Foa0","Flags":2,"AltAddrs":null,"Desc":""},"eth0":{"Index":3,"MTU":1420,"Name":"eth0","HardwareAddr":"3q36zBht","Flags":51,"AltAddrs":null,"Desc":""},"lo":{"Index":1,"MTU":65536,"Name":"lo","HardwareAddr":null,"Flags":37,"AltAddrs":null,"Desc":""},"tailscale0":{"Index":5,"MTU":1280,"Name":"tailscale0","HardwareAddr":null,"Flags":57,"AltAddrs":null,"Desc":""},"teql0":{"Index":4,"MTU":1500,"Name":"teql0","HardwareAddr":null,"Flags":0,"AltAddrs":null,"Desc":""}},"HaveV6":true,"HaveV4":true,"IsExpensive":false,"DefaultRouteInterface":"eth0","HTTPProxy":"","PAC":""}
2024-08-30T22:38:40.122 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 LinkChange: major, rebinding. New state: interfaces.State{defaultRoute=eth0 ifs={eth0:[172.19.9.58/29 172.19.9.59/29 2605:4c40:104:5acf:0:13c:fb24:1/127 fdaa:9:4fd:a7b:2be:13c:fb24:2/112 llu6]} v4=true v6=true}
2024-08-30T22:38:40.123 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 onPortUpdate(port=53947, network=udp6)
2024-08-30T22:38:40.123 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 onPortUpdate(port=48758, network=udp4)
2024-08-30T22:38:40.123 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 Rebind; defIf="eth0", ips=[172.19.9.58/29 172.19.9.59/29 2605:4c40:104:5acf:0:13c:fb24:1/127 fdaa:9:4fd:a7b:2be:13c:fb24:2/112 fe80::dcad:faff:fecc:186d/64]
2024-08-30T22:38:40.123 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 magicsock: 0 active derp conns
2024-08-30T22:38:40.123 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 monitor: gateway and self IP changed: gw=172.19.9.57 self=172.19.9.58
2024-08-30T22:38:40.124 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 pm: using backend prefs for "profile-73c1": Prefs{ra=false dns=true want=true routes=[] statefulFiltering=false nf=on host="fly-app" update=on Persist{lm=, o=, n=[hsyCE] u="joshuarodriguezac@gmail.com"}}
2024-08-30T22:38:40.124 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 logpolicy: using system state directory "/var/lib/tailscale"
2024-08-30T22:38:40.125 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 got LocalBackend in 27ms
2024-08-30T22:38:40.125 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:40 Start
2024-08-30T22:38:41.127 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 timeout waiting for initial portlist
2024-08-30T22:38:41.128 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 Backend: logs: be:5d32a6b048c857c27ca3fec47b074d821d368eb34555ab12bfa410681183a1b7 fe:
2024-08-30T22:38:41.128 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 control: client.Login(0)
2024-08-30T22:38:41.128 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 offline auto-update: starting update checks
2024-08-30T22:38:41.128 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 control: doLogin(regen=false, hasUrl=false)
2024-08-30T22:38:41.129 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 health(warnable=warming-up): error: Tailscale is starting. Please wait.
2024-08-30T22:38:41.132 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 Start
2024-08-30T22:38:41.133 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 Backend: logs: be:5d32a6b048c857c27ca3fec47b074d821d368eb34555ab12bfa410681183a1b7 fe:
2024-08-30T22:38:41.133 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 control: client.Login(0)
2024-08-30T22:38:41.133 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 control: client.Shutdown ...
2024-08-30T22:38:41.133 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 control: mapRoutine: exiting
2024-08-30T22:38:41.134 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 control: doLogin(regen=false, hasUrl=false)
2024-08-30T22:38:41.134 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 control: authRoutine: exiting
2024-08-30T22:38:41.134 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 control: updateRoutine: exiting
2024-08-30T22:38:41.134 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 control: Client.Shutdown done.
2024-08-30T22:38:41.136 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 health(warnable=login-state): error: You are logged out. The last login error was: fetch control key: Get "https://controlplane.tailscale.com/key?v=104": context canceled
2024-08-30T22:38:41.593 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 control: control server key from https://controlplane.tailscale.com: ts2021=[fSeS+], legacy=[nlFWp]
2024-08-30T22:38:41.593 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:41 control: RegisterReq: onode= node=[hsyCE] fup=false nks=false
2024-08-30T22:38:42.041 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 control: RegisterReq: got response; nodeKeyExpired=false, machineAuthorized=true; authURL=false
2024-08-30T22:38:42.042 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 health(warnable=login-state): ok
2024-08-30T22:38:42.197 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 control: netmap: got new dial plan from control
2024-08-30T22:38:42.197 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 using tailnet default auto-update setting: true
2024-08-30T22:38:42.197 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 EditPrefs: MaskedPrefs{AutoUpdate={Apply=true}}
2024-08-30T22:38:42.198 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 health(warnable=not-in-map-poll): ok
2024-08-30T22:38:42.199 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 active login: joshuarodriguezac@gmail.com
2024-08-30T22:38:42.200 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 Switching ipn state NoState -> Starting (WantRunning=true, nm=true)
2024-08-30T22:38:42.200 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 magicsock: SetPrivateKey called (init)
2024-08-30T22:38:42.200 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 wgengine: Reconfig: configuring userspace WireGuard config (with 0/3 peers)
2024-08-30T22:38:42.201 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 wgengine: Reconfig: configuring router
2024-08-30T22:38:42.251 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 wgengine: Reconfig: configuring DNS
2024-08-30T22:38:42.251 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 dns: Set: {DefaultResolvers:[] Routes:{tailfc8bef.ts.net.:[] ts.net.:[199.247.155.53 2620:111:8007::53]}+65arpa SearchDomains:[tailfc8bef.ts.net.] Hosts:4}
2024-08-30T22:38:42.251 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 dns: Resolvercfg: {Routes:{.:[fdaa::3] ts.net.:[199.247.155.53 2620:111:8007::53]} Hosts:4 LocalDomains:[tailfc8bef.ts.net.]+65arpa}
2024-08-30T22:38:42.251 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 dns: OScfg: {Nameservers:[100.100.100.100] SearchDomains:[tailfc8bef.ts.net.] }
2024-08-30T22:38:42.251 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 peerapi: serving on http://100.94.161.97:34510
2024-08-30T22:38:42.251 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 peerapi: serving on http://[fd7a:115c:a1e0::9401:a161]:61251
2024-08-30T22:38:42.453 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 magicsock: home is now derp-17 (lax)
2024-08-30T22:38:42.453 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 magicsock: endpoints changed: 216.246.104.95:48758 (stun), [2605:4c40:104:5acf:0:13c:fb24:1]:53947 (stun), 172.19.9.58:48758 (local), 172.19.9.59:48758 (local), [2605:4c40:104:5acf:0:13c:fb24:1]:48758 (local)
2024-08-30T22:38:42.453 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 magicsock: adding connection to derp-17 for home-keep-alive
2024-08-30T22:38:42.453 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 magicsock: 1 active derp conns: derp-17=cr0s,wr0s
2024-08-30T22:38:42.453 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 offline auto-update: stopping update checks
2024-08-30T22:38:42.453 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 Switching ipn state Starting -> Running (WantRunning=true, nm=true)
2024-08-30T22:38:42.454 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 control: NetInfo: NetInfo{varies=false hairpin= ipv6=true ipv6os=true udp=true icmpv4=false derp=#17 portmap= link="" firewallmode="ipt-default"}
2024-08-30T22:38:42.455 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 derphttp.Client.Connect: connecting to derp-17 (lax)
2024-08-30T22:38:42.455 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 health(warnable=warming-up): ok
2024-08-30T22:38:42.456 app[e825d66b7296e8] lax [info] /app/start.sh: line 5: /app/my-app: not found
2024-08-30T22:38:42.486 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 magicsock: derp-17 connected; connGen=1
2024-08-30T22:38:42.487 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 health(warnable=no-derp-home): ok
2024-08-30T22:38:42.487 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 health(warnable=no-derp-connection): ok
2024-08-30T22:38:42.487 app[e825d66b7296e8] lax [info] 2024/08/30 22:38:42 [RATELIMIT] format("health(warnable=%s): ok")
2024-08-30T22:38:42.948 app[e825d66b7296e8] lax [info] INFO Main child exited normally with code: 127
2024-08-30T22:38:42.961 app[e825d66b7296e8] lax [info] INFO Starting clean up.
2024-08-30T22:38:42.964 app[e825d66b7296e8] lax [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2024-08-30T22:38:42.965 app[e825d66b7296e8] lax [info] [ 3.709342] reboot: Restarting system
2024-08-30T22:38:43.110 runner[e825d66b7296e8] lax [info] machine has reached its max restart count (10)

There is an error in your logs, you just have to find it. Once you do, it’ll be obvious where the problem is.

Here’s a decent article about Dockerfiles: A step-by-step guide to create Dockerfile | by Anshita Bhasin | Medium

refreshed the keys. thanks for spotting the silly error but the machine still exits right after creation - deployment and launch successful. Any clues?


Waiting for logs...

2024-08-31T02:21:23.229 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 dns: using "direct" mode

2024-08-31T02:21:23.229 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 dns: using *dns.directManager

2024-08-31T02:21:23.251 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 wgengine.NewUserspaceEngine(tun "tailscale0") ...

2024-08-31T02:21:23.257 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 dns: [rc=unknown ret=direct]

2024-08-31T02:21:23.257 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 dns: using "direct" mode

2024-08-31T02:21:23.257 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 dns: using *dns.directManager

2024-08-31T02:21:23.257 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 link state: interfaces.State{defaultRoute=eth0 ifs={eth0:[172.19.12.202/29 172.19.12.203/29 2605:4c40:104:6f43:0:ff0c:629f:1/127 fdaa:9:4fd:a7b:2b4:ff0c:629f:2/112 llu6]} v4=true v6=true}

2024-08-31T02:21:23.257 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 onPortUpdate(port=39920, network=udp6)

2024-08-31T02:21:23.258 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 router: using firewall mode pref

2024-08-31T02:21:23.258 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 router: default choosing iptables

2024-08-31T02:21:23.263 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 router: netfilter running in iptables mode v6 = true, v6filter = true, v6nat = true

2024-08-31T02:21:23.263 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 onPortUpdate(port=51337, network=udp4)

2024-08-31T02:21:23.263 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 magicsock: disco key = d:9d723c363c86d649

2024-08-31T02:21:23.263 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 Creating WireGuard device...

2024-08-31T02:21:23.264 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 Bringing WireGuard device up...

2024-08-31T02:21:23.264 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 Bringing router up...

2024-08-31T02:21:23.264 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 Clearing router settings...

2024-08-31T02:21:23.264 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 Starting network monitor...

2024-08-31T02:21:23.264 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 Engine created.

2024-08-31T02:21:23.266 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 external route: up

2024-08-31T02:21:23.269 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 monitor: [unexpected] network state changed, but stringification didn't: interfaces.State{defaultRoute=eth0 ifs={eth0:[172.19.12.202/29 172.19.12.203/29 2605:4c40:104:6f43:0:ff0c:629f:1/127 fdaa:9:4fd:a7b:2b4:ff0c:629f:2/112 llu6]} v4=true v6=true}

2024-08-31T02:21:23.269 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 monitor: [unexpected] old: {"InterfaceIPs":{"dummy0":null,"eth0":["172.19.12.202/29","172.19.12.203/29","2605:4c40:104:6f43:0:ff0c:629f:1/127","fdaa:9:4fd:a7b:2b4:ff0c:629f:2/112","fe80::dcad:4aff:feba:cd84/64"],"lo":["127.0.0.1/8","::1/128"],"teql0":null},"Interface":{"dummy0":{"Index":2,"MTU":1500,"Name":"dummy0","HardwareAddr":"EmTr7qdl","Flags":2,"AltAddrs":null,"Desc":""},"eth0":{"Index":3,"MTU":1420,"Name":"eth0","HardwareAddr":"3q1Kus2E","Flags":51,"AltAddrs":null,"Desc":""},"lo":{"Index":1,"MTU":65536,"Name":"lo","HardwareAddr":null,"Flags":37,"AltAddrs":null,"Desc":""},"teql0":{"Index":4,"MTU":1500,"Name":"teql0","HardwareAddr":null,"Flags":0,"AltAddrs":null,"Desc":""}},"HaveV6":true,"HaveV4":true,"IsExpensive":false,"DefaultRouteInterface":"eth0","HTTPProxy":"","PAC":""}

2024-08-31T02:21:23.270 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 monitor: [unexpected] new: {"InterfaceIPs":{"dummy0":null,"eth0":["172.19.12.202/29","172.19.12.203/29","2605:4c40:104:6f43:0:ff0c:629f:1/127","fdaa:9:4fd:a7b:2b4:ff0c:629f:2/112","fe80::dcad:4aff:feba:cd84/64"],"lo":["127.0.0.1/8","::1/128"],"tailscale0":["fe80::5f0c:2ed5:653e:2083/64"],"teql0":null},"Interface":{"dummy0":{"Index":2,"MTU":1500,"Name":"dummy0","HardwareAddr":"EmTr7qdl","Flags":2,"AltAddrs":null,"Desc":""},"eth0":{"Index":3,"MTU":1420,"Name":"eth0","HardwareAddr":"3q1Kus2E","Flags":51,"AltAddrs":null,"Desc":""},"lo":{"Index":1,"MTU":65536,"Name":"lo","HardwareAddr":null,"Flags":37,"AltAddrs":null,"Desc":""},"tailscale0":{"Index":5,"MTU":1280,"Name":"tailscale0","HardwareAddr":null,"Flags":57,"AltAddrs":null,"Desc":""},"teql0":{"Index":4,"MTU":1500,"Name":"teql0","HardwareAddr":null,"Flags":0,"AltAddrs":null,"Desc":""}},"HaveV6":true,"HaveV4":true,"IsExpensive":false,"DefaultRouteInterface":"eth0","HTTPProxy":"","PAC":""}

2024-08-31T02:21:23.270 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 LinkChange: major, rebinding. New state: interfaces.State{defaultRoute=eth0 ifs={eth0:[172.19.12.202/29 172.19.12.203/29 2605:4c40:104:6f43:0:ff0c:629f:1/127 fdaa:9:4fd:a7b:2b4:ff0c:629f:2/112 llu6]} v4=true v6=true}

2024-08-31T02:21:23.270 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 onPortUpdate(port=39920, network=udp6)

2024-08-31T02:21:23.270 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 onPortUpdate(port=51337, network=udp4)

2024-08-31T02:21:23.270 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 Rebind; defIf="eth0", ips=[172.19.12.202/29 172.19.12.203/29 2605:4c40:104:6f43:0:ff0c:629f:1/127 fdaa:9:4fd:a7b:2b4:ff0c:629f:2/112 fe80::dcad:4aff:feba:cd84/64]

2024-08-31T02:21:23.270 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 magicsock: 0 active derp conns

2024-08-31T02:21:23.271 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 monitor: gateway and self IP changed: gw=172.19.12.201 self=172.19.12.202

2024-08-31T02:21:23.272 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 pm: migrating "_daemon" profile to new format

2024-08-31T02:21:23.272 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 logpolicy: using system state directory "/var/lib/tailscale"

2024-08-31T02:21:23.272 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 got LocalBackend in 22ms

2024-08-31T02:21:23.272 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:23 Start

2024-08-31T02:21:24.274 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 timeout waiting for initial portlist

2024-08-31T02:21:24.274 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 Backend: logs: be:dd217951fcc5992cad061c9dc4b9ae259804e32aaef59fb751b82af67a9a3a2f fe:

2024-08-31T02:21:24.274 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 Switching ipn state NoState -> NeedsLogin (WantRunning=false, nm=false)

2024-08-31T02:21:24.274 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 blockEngineUpdates(true)

2024-08-31T02:21:24.275 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 wgengine: Reconfig: configuring userspace WireGuard config (with 0/0 peers)

2024-08-31T02:21:24.275 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 wgengine: Reconfig: configuring router

2024-08-31T02:21:24.275 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 wgengine: Reconfig: configuring DNS

2024-08-31T02:21:24.275 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 dns: Set: {DefaultResolvers:[] Routes:{} SearchDomains:[] Hosts:0}

2024-08-31T02:21:24.275 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 dns: Resolvercfg: {Routes:{} Hosts:0 LocalDomains:[]}

2024-08-31T02:21:24.275 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 dns: OScfg: {}

2024-08-31T02:21:24.276 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 health(warnable=wantrunning-false): error: Tailscale is stopped.

2024-08-31T02:21:24.279 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 Start

2024-08-31T02:21:24.279 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 generating new machine key

2024-08-31T02:21:24.280 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 machine key written to store

2024-08-31T02:21:24.280 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 Backend: logs: be:dd217951fcc5992cad061c9dc4b9ae259804e32aaef59fb751b82af67a9a3a2f fe:

2024-08-31T02:21:24.280 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 Switching ipn state NoState -> NeedsLogin (WantRunning=true, nm=false)

2024-08-31T02:21:24.280 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 blockEngineUpdates(true)

2024-08-31T02:21:24.280 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 control: client.Shutdown ...

2024-08-31T02:21:24.280 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 control: mapRoutine: exiting

2024-08-31T02:21:24.280 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 health(warnable=warming-up): error: Tailscale is starting. Please wait.

2024-08-31T02:21:24.280 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 health(warnable=wantrunning-false): ok

2024-08-31T02:21:24.280 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 control: authRoutine: exiting

2024-08-31T02:21:24.280 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 control: updateRoutine: exiting

2024-08-31T02:21:24.280 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 control: Client.Shutdown done.

2024-08-31T02:21:24.281 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 StartLoginInteractive: url=false

2024-08-31T02:21:24.281 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 control: client.Login(2)

2024-08-31T02:21:24.281 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 control: LoginInteractive -> regen=true

2024-08-31T02:21:24.281 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 control: doLogin(regen=true, hasUrl=false)

2024-08-31T02:21:24.749 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 control: control server key from https://controlplane.tailscale.com: ts2021=[fSeS+], legacy=[nlFWp]

2024-08-31T02:21:24.749 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 control: Generating a new nodekey.

2024-08-31T02:21:24.751 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:24 control: RegisterReq: onode= node=[OWx3/] fup=false nks=false

2024-08-31T02:21:26.327 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 control: RegisterReq: got response; nodeKeyExpired=false, machineAuthorized=true; authURL=false

2024-08-31T02:21:26.327 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 blockEngineUpdates(false)

2024-08-31T02:21:26.484 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 control: netmap: got new dial plan from control

2024-08-31T02:21:26.484 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 using tailnet default auto-update setting: true

2024-08-31T02:21:26.484 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 EditPrefs: MaskedPrefs{AutoUpdate={Apply=true}}

2024-08-31T02:21:26.484 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 offline auto-update: starting update checks

2024-08-31T02:21:26.485 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 health(warnable=not-in-map-poll): ok

2024-08-31T02:21:26.486 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 active login: 

2024-08-31T02:21:26.494 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 Switching ipn state NeedsLogin -> Starting (WantRunning=true, nm=true)

2024-08-31T02:21:26.495 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 magicsock: SetPrivateKey called (init)

2024-08-31T02:21:26.495 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 wgengine: Reconfig: configuring userspace WireGuard config (with 0/2 peers)

2024-08-31T02:21:26.495 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 wgengine: Reconfig: configuring router

2024-08-31T02:21:26.539 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 wgengine: Reconfig: configuring DNS

2024-08-31T02:21:26.539 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 dns: Set: {DefaultResolvers:[] Routes:{tailfc8bef.ts.net.:[] ts.net.:[199.247.155.53 2620:111:8007::53]}+65arpa SearchDomains:[tailfc8bef.ts.net.] Hosts:3}

2024-08-31T02:21:26.539 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 dns: Resolvercfg: {Routes:{.:[fdaa::3] ts.net.:[199.247.155.53 2620:111:8007::53]} Hosts:3 LocalDomains:[tailfc8bef.ts.net.]+65arpa}

2024-08-31T02:21:26.539 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 dns: OScfg: {Nameservers:[100.100.100.100] SearchDomains:[tailfc8bef.ts.net.] }

2024-08-31T02:21:26.539 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 peerapi: serving on http://100.107.93.18:44930

2024-08-31T02:21:26.539 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 peerapi: serving on http://[fd7a:115c:a1e0::3e01:5d13]:53730

2024-08-31T02:21:26.740 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 magicsock: home is now derp-17 (lax)

2024-08-31T02:21:26.740 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 magicsock: endpoints changed: 216.246.104.80:51337 (stun), [2605:4c40:104:6f43:0:ff0c:629f:1]:39920 (stun), 172.19.12.202:51337 (local), 172.19.12.203:51337 (local), [2605:4c40:104:6f43:0:ff0c:629f:1]:51337 (local)

2024-08-31T02:21:26.740 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 magicsock: adding connection to derp-17 for home-keep-alive

2024-08-31T02:21:26.740 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 magicsock: 1 active derp conns: derp-17=cr0s,wr0s

2024-08-31T02:21:26.740 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 offline auto-update: stopping update checks

2024-08-31T02:21:26.740 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 Switching ipn state Starting -> Running (WantRunning=true, nm=true)

2024-08-31T02:21:26.740 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 control: NetInfo: NetInfo{varies=false hairpin= ipv6=true ipv6os=true udp=true icmpv4=false derp=#17 portmap= link="" firewallmode="ipt-default"}

2024-08-31T02:21:26.740 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 derphttp.Client.Connect: connecting to derp-17 (lax)

2024-08-31T02:21:26.741 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 health(warnable=warming-up): ok

2024-08-31T02:21:26.754 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 magicsock: derp-17 connected; connGen=1

2024-08-31T02:21:26.754 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 health(warnable=no-derp-home): ok

2024-08-31T02:21:26.755 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 health(warnable=no-derp-connection): ok

2024-08-31T02:21:26.755 app[6e825deeb00e78] lax [info] 2024/08/31 02:21:26 [RATELIMIT] format("health(warnable=%s): ok")

2024-08-31T02:21:27.141 app[6e825deeb00e78] lax [info] INFO Main child exited normally with code: 0

2024-08-31T02:21:27.155 app[6e825deeb00e78] lax [info] INFO Starting clean up.

2024-08-31T02:21:27.165 app[6e825deeb00e78] lax [info] WARN could not unmount /rootfs: EINVAL: Invalid argument

2024-08-31T02:21:27.166 app[6e825deeb00e78] lax [info] [ 4.691862] reboot: Restarting system

2024-08-31T02:21:27.439 runner[6e825deeb00e78] lax [info] machine exited with exit code 0, not restarting

looks like your “/app/my-app” process is exiting w/ code 0, which shuts down the machine.

1 Like

Added mysql

Meta note: @khuezy, you can add tags and edit post titles now—in case the system’s notification to that effect got lost.

https://community.fly.io/badges/3/regular?username=khuezy

(The forum software does lose notifications sometimes, maybe due to a flakey queue.)

It’s the little pencil icon at the right edge of the <h1>.

1 Like

Could you show me how to properly start the mysql instance? I read the documentation but the advice is pretty much ’ just install the already existing docker image through the toml '.
But of course, the docker image and the vpn are two different processes

Since you are a self proclaimed “noob”, I have to ask: do you really want to manage your own database cluster? Probably not (see all the postgres issues people are having w/ their own self managed clusters.) Even for experts, I wouldn’t self manage my own db. Use a managed one like planetscale or sign up for the beta of Fly’s managed db.

the mysql is somewhere else in my tailnet. Another mysql instance is (i believe, not sure) the quickest and most efficient way to do queries in this other instance + having the mysql server running on the tailnet is a great exercise.

A functional and simple example on how to connect a fly app to tailscale would be great (the on in the tail scale site doesnt run)