balena-os / balena-supervisor

Balena Supervisor: balena's agent on devices.
https://balena.io
Other
148 stars 63 forks source link

Supervisor changes encoding of emojis (UTF8 character) so that emoji is not rendered properly after consuming logs from api #2171

Open jellyfish-bot opened 1 year ago

jellyfish-bot commented 1 year ago

[fisehara] - User reports failing emoji 🚀 rendering when balena service logs emojis to the containers logs

curl -H "Authorization: Bearer <deviceKey>" https://api.balena-cloud.com/device/v2/<deviceUuid>/logs --json '[{"timestamp":1684488299969,"serviceId":2146730,"message":"sent to: 🚀\r"}]'

Using the log-streamer for testing the stream endpoint also succeeds.

I locally built the log-streamer docker container containing the rocket emoji into the test masses and run it locally

➜  log-streamer git:(main) ✗ $ docker run --rm -ti -e UUID=<deviceUUID> -e API_KEY=<deviceAPIKey> -e SERVICE_ID=2146730 docker.io/library/log-streamer 
Fri, 19 May 2023 10:38:25 GMT - Test message No. 0 🚀. Next message in 1(s)

I conclude that in some way the supervisor (14.9.2)is changing / not properly digesting the log message from the hostOS journalctl stream and sends the data already tainted to the balenaAPI log endpoints.

jellyfish-bot commented 1 year ago

[fisehara] This has attached https://jel.ly.fish/56766023-6c22-4c3b-9369-69be5ff7b9ad