-
-
Notifications
You must be signed in to change notification settings - Fork 398
Description
Description
When accessing SolidTime through a domain routed via Cloudflare Tunnel, the backend fails to insert audit records because an invalid IPv6 address is being stored in the ip_address field (PostgreSQL type inet).
SQLSTATE[22P02]: Invalid text representation: 7 ERROR:
invalid input syntax for type inet: "fd14:541e:9dd6:0:0"
CONTEXT: unnamed portal parameter $9 = 'fd14:541e:9dd6:0:0'
Steps To Reproduce
Configure a domain for the SolidTime instance behind Cloudflare Tunnel (Cloudflare Zero Trust / Tunnel + WARP routing enabled).
Open the SolidTime web app through that tunneled domain (e.g. https://solidtime.example.com).
Authenticate as any user with permission to update a time entry.
Perform an action that triggers an audit record, for example:
Edit an existing time entry and save changes; or
Update any resource that writes to the audits table.
Inspect the server logs. You will see a QueryException similar to:
SQLSTATE[22P02]: Invalid text representation: 7 ERROR:
invalid input syntax for type inet: "fd14:541e:9dd6:0:0"
(Optional) Reproduce with a manual request that simulates the tunneled IP in a forwarded header. Example curl that mimics a proxied request:
curl -X POST "https://solidtime.example.com/api/v1/organizations/<org>/time-entries/<id>" \
-H "Authorization: Bearer <token>" \
-H "X-Forwarded-For: fd14:541e:9dd6:0:0" \
-H "User-Agent: curl/8.0" \
-d '{"some":"payload"}'
The backend will attempt to store fd14:541e:9dd6:0:0 into the audits.ip_address (Postgres inet) and trigger the same error.
Expected result
The audit is created successfully. The ip_address is either a valid IPv4/IPv6 or NULL if not parseable.
Actual result
The database rejects the value with invalid input syntax for type inet, causing the request to fail and an exception to be logged.
Self-hosted or Cloud?
Self-Hosted
Version of solidtime: (for self-hosted)
v0.10.0
solidtime self-hosting guide: (for self-hosted)
No response