You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
smee client crashes when quoting bot comments (because of emojis?) #320
For my RISC-V bot I noticed that the smee client crashed a couple of times with:
node:_http_outgoing:628
throw new ERR_INVALID_CHAR('header content', name);
^
TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["rawdata"]
at ClientRequest.setHeader (node:_http_outgoing:651:3)
at Request.request (/home/bot/smee/node_modules/superagent/lib/node/index.js:873:39)
at Request.end (/home/bot/smee/node_modules/superagent/lib/node/index.js:989:8)
at Client.onmessage (/home/bot/smee/node_modules/smee-client/index.js:35:13)
at EventSource.emit (node:events:514:28)
at _emit (/home/bot/smee/node_modules/eventsource/lib/eventsource.js:264:17)
at parseEventStreamLine (/home/bot/smee/node_modules/eventsource/lib/eventsource.js:279:9)
at IncomingMessage.<anonymous> (/home/bot/smee/node_modules/eventsource/lib/eventsource.js:238:11)
at IncomingMessage.emit (node:events:514:28)
at addChunk (node:internal/streams/readable:324:12) {
code: 'ERR_INVALID_CHAR'
}
It doesn't really give enough information to understand why/for which message it crashed, but based on timings I already had an assumptions that it could be related to quoting bot messages. Now I just saw that @boegel did that in EESSI/software-layer#1116 (comment), and I checked the RISC-V and AWS bots right after that, and both had indeed crashed. So I guess smee cannot handle something in those messages, perhaps the emojis? Not sure if we can do something about it, but perhaps we can do some filtering somewhere?
This smells like a bug in smee to me. The event smee receives comes straight from GitHub, so I don't think we can do any filtering to prevent this from happening...
Updating the a newer version of smee-client should fix this problem.
A bot using smee-client 2.0.4 has been known to be robust against this.
I updated the bot instance for EESSI on the AWS cluster to smee-client version to 4.2.1 (by moving the node_modules directory and running npm install smee-client again). After also updating nodejs to 20.19, I then saw a failure to process an event for EESSI/software-layer-scripts#2 because there was a … at the end of the PR title:
TypeError: Cannot convert argument to a ByteString because the character at index 664 has a value of 8230 which is greater than 255.
at Client.fetch (/home/bot/smee/node_modules/undici/index.js:123:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async #onmessage (file:///home/bot/smee/node_modules/smee-client/index.js:39:30)
It seems like that's a known unresolved problem in smee-client, see probot/smee-client#319
The good news is that smee no longer crashes hard, it just reports that TypeError, and then keeps listening to additional events.
The new Smee client from our container has been running on the RISC-V cluster for about two weeks now, and it hasn't crashed anymore. With the older client it would crash a few times per week. So it looks like this has indeed solved the issue, though I suppose we may still have to be careful with bot instructions that include emojis (I suspect that it will ignore them and report an error? But there's not much that we can do about it).
Activity
boegel commentedon Jun 10, 2025
Also happened on Deucalion, so CPU family has nothing to do with it.
boegel commentedon Jun 10, 2025
This smells like a bug in smee to me. The event smee receives comes straight from GitHub, so I don't think we can do any filtering to prevent this from happening...
We can try reporting it upstream via https://github.com/probot/smee-client ?
boegel commentedon Jun 12, 2025
Updating the a newer version of
smee-clientshould fix this problem.A bot using
smee-client2.0.4 has been known to be robust against this.I updated the bot instance for EESSI on the AWS cluster to smee-client version to 4.2.1 (by moving the
node_modulesdirectory and runningnpm install smee-clientagain). After also updatingnodejsto 20.19, I then saw a failure to process an event for EESSI/software-layer-scripts#2 because there was a…at the end of the PR title:It seems like that's a known unresolved problem in
smee-client, see probot/smee-client#319The good news is that
smeeno longer crashes hard, it just reports thatTypeError, and then keeps listening to additional events.A comment that includes an emoji (like EESSI/software-layer-scripts#2 (comment)) does trigger the
TypeError, but thesmeesession doesn't crash anymore.bedroge commentedon Jun 16, 2025
We have a container image with the latest Smee client available now: https://github.com/EESSI/eessi-bot-software-layer/pkgs/container/smee-client
bedroge commentedon Jun 27, 2025
The new Smee client from our container has been running on the RISC-V cluster for about two weeks now, and it hasn't crashed anymore. With the older client it would crash a few times per week. So it looks like this has indeed solved the issue, though I suppose we may still have to be careful with bot instructions that include emojis (I suspect that it will ignore them and report an error? But there's not much that we can do about it).