2 years ago
I've deployed hasura docker image from my private github repo, and it starts tailscale before hasura using this command
CMD /tailscale.d/tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/var/run/tailscale/tailscaled.sock --tun=userspace-networking --socks5-server=localhost:1055 --outbound-http-proxy-listen=localhost:1055 & \
/tailscale.d/tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname=${TAILSCALE_HOSTNAME} --ssh \
&& graphql-engine serveIt deploys and works good, but I can see only tailscaled logs and hasura logs appear as empty strings to stdout
I tried the same image on my machine and I can see the logs, so I think it's something with railway
11 Replies
2 years ago
I've never seen this before, it's super strange since from my understanding whitespace is stripped from log lines and then the log line is skipped if it's empty after that processing.
Please provide a public GitHub repository and steps to reproduce this.
2 years ago
Minimal reproduction repo: https://github.com/Andrew-Bekhiet/railway-stdout-bug/
You will need to provide HASURAGRAPHQLDATABASEURL env var and point it to a postgres database, and TAILSCALEAUTHKEY or alternatively click on the tailscale login link when the container starts to login to tailscale and start hasura graphql engine
2 years ago
May I ask what hasura graphql has to do with tailscale, or why tailscale is being used?
2 years ago
Hasura is the primary service, I used to use tailscale to securely connect to the database hosted on a different platform, but it's currently on railway so I think I should remove it now
2 years ago
I removed tailscale and connected the db using railway private networking but the logs are still empty
Now I'm not sure if this is a problem with hasura or railway
2 years ago
A team member has graciously informed me that you are using structured logging without a msg / message attribute therefore the logs appear to be blank, but if you hover over a log line and expand it's context you will see the other log attributes.
2 years ago
Oh, I didn't notice that. It would be nice if I could configure the json path for the log message though.
For now I would use some parser to add the msg key to the structured log message
2 years ago
What attribute contains the message? would you mind attaching a screenshot of the attributes as they show in the Railway logs, for my curiosity?
2 years ago
Unfortunately, they are more involved that I thought, but I think hasura might have a json schema for these logs. I don't expect railway to support complex parsing
Attachments
2 years ago
You're right, that's going to be quite involved, even axiom or betterstack would not know what to make of those logs.
Maybe you could write a parser that would simply look for the first attribute in this list and then set it to the message attribute?
$.detail.operation.error.error
$.detail.info
$.detail.info.message
$.detailI have a feeling there would also be more attributes you would want to check, but you get the idea.