The i3 FAQ has migrated to All content here is read-only.
Ask Your Question

i3bar random JSON UTF-8 error w/ conky

asked 2014-02-02 10:24:22 +0000

idrei gravatar image

updated 2014-02-02 15:47:57 +0000


randomly (sometimes 5 Minutes, sometimes 5 hours after bootup), my i3bar, which gets its input from conky an runs on Arch, fails, returning the following in red:

Error: could not parse JSON (lexical error: invalid bytes in utf8 string.)

To get it to work again, I simply have to restart i3.

I tried googleing quite a while, but I didn't find anything helpful for this case… I don't have any special characters like a degree symbol in my conkyrc, my system's completely on UTF-8. The thing that is so creepy about it is the fact that this happens really randomly and I don't even know by what this is caused or how to reproduce it.

For example, today, it happened for the first time 2 hours after bootup, then again 3 minutes after restarting and ever since then, it runs stable.

I tried disabling every conky element I've got in my rc seperately, but none of them seems to be the cause, it's still happing…

Anyone who has a guess where this might come from? Thank you!

Edit: So here's a part of the strace output, don't know if this is the relevant section:

read(0, 0x9f8512, 62)                   = -1 EAGAIN (Resource temporarily unavailable)
write(2, "[i3bar] Could not parse JSON input (code = 2, message = lexical error: invalid bytes in UTF8 string.): [{\"full_text\":\"CPU:\",\"color\":\"#606060\",\"separator\":false,\"separator_block_width\":0},{\"full_text\":\"1%,1.40GHz\",\"separator\":false,\"separator_block_width\":9},{\"full_text\":\"MEM:\",\"color\":\"#606060\",\"separator\":false,\"separator_block_width\":0},{\"full_text\":\"6;0%,484MiB\",\"separator\":false,\"separator_block_width\":9},

and so it goes on… Any ideas?

edit retag flag offensive close merge delete


strace i3bar to see what it’s choking on. I.e.: strace -f -p $(pidof i3bar) -s 2048

Michael gravatar imageMichael ( 2014-02-02 10:27:03 +0000 )edit

Ok thank you, I'm now waiting till it fails again, and then, you'll get the strace-output.

idrei gravatar imageidrei ( 2014-02-02 10:42:50 +0000 )edit

Ehm… the output's kinda endless, is there something I should look for in detail? It's curious: this time, it took about half and an hour till this happend… Btw. I let conky refresh every second, don't know if this is relevant, perhaps it isn't, but what do I know.

idrei gravatar imageidrei ( 2014-02-02 15:38:54 +0000 )edit

1 answer

Sort by » oldest newest most voted

answered 2014-02-02 17:40:48 +0000

idrei gravatar image

Sorry I have to answer myself but there seems to be no other way… Anyway, I took two logs with strace, one good, one bad, and there the exactely same until it comes to this line:

read(0, 0x1102690, 896)                 = -1 EAGAIN (Resource temporarily unavailable)

After that line, the good, where everthing's fine looks like the following:

poll([{fd=5, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=5, revents=POLLOUT}])
[{"F\0\5\0\4\0\300\0\5\0\300\0\0\ […]

… and the bad, where it fails, looks like:

write(2, "[i3bar] Could not parse JSON input (code = 2, message = lexical error: invalid bytes in UTF8 string.): [ 
{\"full_text\":\"CPU:\",\"color\":\"#606060\",\"separator\":false,\"separator_block_width\":0}, […]

When it finally comes to writev in the bad one, there are things like !!!\377!!!\377F which doesn't seem to be there in the good one…

But I still cannot see why all this is happening. :(

edit flag offensive delete link more


So? Does no answer mean I should better write a bugreport for this??

idrei gravatar imageidrei ( 2014-02-04 08:54:12 +0000 )edit

It's possible this is a bug in the bar. Write a bug report and I'll look into it.

TonyC gravatar imageTonyC ( 2014-02-05 00:29:18 +0000 )edit


idrei gravatar imageidrei ( 2014-02-05 12:34:54 +0000 )edit

Question Tools


Asked: 2014-02-02 10:24:22 +0000

Seen: 899 times

Last updated: Feb 02 '14