-
Notifications
You must be signed in to change notification settings - Fork 302
systemd hides the fact that there exists a maximum unit file line length #992
Comments
@totemteleko The error seems to be "String is not UTF-8 clean, ignoring assignment:", which is at the beginning of the second log line you provided. This can also be reproduced directly with systemd, so this isn't actually a fleet bug. Regardless, I'll definitely help you figure this out. |
Yes, it says about the UTF-8, but it's because it cuts the content. The line should finish with --ttl 90; /usr/bin/sleep 30; done" The problem appears just with the length, because this file is auto generated and loops in a array of ports, and if I put 2 it works, but not if I add more. In fact, I have the same problem with the other commands: ExecStop, ExecStopPost, etc, and splitting them into several ExecStopPost I don´t get any error. For example this works because is a shorter modification of the first:
|
@totemteleko Yes, I believe you're correct. I'm digging into systemd code now to find the limit. btw it would help readability of your comments if you format code blocks with backticks. I updated your initial bug report as an example. |
@totemteleko in my testing, it looks like 2048 characters is the effective maximum. Still trying to grok the code. |
Ok, figured it out. The |
Filed here: https://bugs.freedesktop.org/show_bug.cgi?id=85308. @totemteleko Anything else we need to dig into here? |
No, I just wanted to assure that was the problem. Thank you very much. 2014-10-22 2:01 GMT+02:00 Brian Waldon notifications@github.com:
Best regards, Roberto Jiménez Sánchez. |
I too, just stumbled on this problem. |
we resort to this solution as a workaround to the issue of Systemd having a maximum of 2048 characters per line for more information: coreos/fleet#992
Lennart confirmed my findings on the upstream systemd bug, so hopefully we make some progress there. I believe the best thing we can do here is to add a line-length check in coreos/go-systemd#69. |
@totemteleko What if you split the line using backslashes? |
+1 This affected us pretty badly. We added 2 env vars to unit file, and damn we are down. @hvolpers For some reason, I only hit the limit if I use backslashes with 45 lines. |
+1 |
Systemd allows users to break the 2048 line limit by injecting backslashes and linebreaks. Sadly fleet (I think the Interestingly I have to add even more linebreaks pairs to make it working with systemd too (It seems the line length was really ~255 chars with Systemd 208). => Can we at least fix this in fleet? Example file: https://gist.github.com/ZeissS/f02dd7788910aa422e90 (test worked with systemd) - just remove the \ linebreaks. |
+1, this is a real critical issue |
+1 |
2 similar comments
+1 |
+1 |
I didn't get why fleet strips all line endings, with them systemd can work properly. |
+1, fleet should not automatically removing backslashes and linebreaks to hit the systemd bugs. |
@wuqixuan There was a merge last week which should fix that. I am not sure how fast this will end up in fleet though - if you can build fleet yourself you can probably already test it. See coreos/go-systemd#108 |
Right, this needs the dependency to be bumped in fleet. On Mon, Sep 28, 2015 at 3:58 PM, Stephan notifications@github.com wrote:
|
Just ran into this issue again and breaking lines with "" does not seem to be working. When is the fix planned to be released for this ? |
There's no current timeline. The fix is at #1375 but I did not merge it On Mon, Nov 16, 2015 at 1:23 PM, Sukrit Khera notifications@github.com
|
+1 |
@jonboulle What file do you think may cause breakage? Until now malformed files are not loaded properly by systemd, because the submit step in fleetctl already malformed them afaict. So merging this shouldn't magically fix those old files and lead to execution, as they are still being broken in fleet right? The only change could be that when users destroy and resubmit those files they suddenly work, but I think thats part of fixing bugs ;) |
thx for merging! |
Hello,
I think that the ExecStart in the unit files has a limitation with the length of the command. It cuts the command and indicates "Missing '='.
Does this limit exists really ?
This is the error:
And this is the unit file:
The text was updated successfully, but these errors were encountered: