Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Useless error message - Invalid escape sequences in line, correcting: #4697

Closed
2 tasks
thx1111 opened this issue Nov 19, 2016 · 2 comments
Closed
2 tasks

Useless error message - Invalid escape sequences in line, correcting: #4697

thx1111 opened this issue Nov 19, 2016 · 2 comments

Comments

@thx1111
Copy link

thx1111 commented Nov 19, 2016

  • Bug report
  • Request for enhancement (RFE)

systemd 232-3

Arch

The journal reports:
Invalid escape sequences in line, correcting: "..."
and then prints the line exactly as it was written in the service file!

At least printing the corrected line would allow a diff to discover what text triggered the error message!

More than that, if the "invalid escape sequence" can be "corrected", then, in what way is the line "invalid"? That's crazy talk.

man systemd.service has a Table 2 of "C escapes supported in command lines and environment variables", but is pretty vague about how the quote escapes should be applied, or whether they need to be applied at all. Generally, they are not needed, making the quoting rules rather "opaque".

Trial and error shows that systemd is a bit more particular about escaping the backslash.

@poettering
Copy link
Member

well, we try to fix the borked strings for you, to be nice (in particular as the precise semantics originally were quite broken) but we do log about them, as there are some ambiguities left, and we'd prefer if the users would write the correct strings in the first place.

But yeah, we should probably log the fixed version, indeed.

Can you provide the exact setting that caused this warning for you?

@poettering poettering added needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer pid1 labels Nov 21, 2016
@thx1111
Copy link
Author

thx1111 commented Nov 21, 2016

This is the corrected version:
... |sed -n "s/.*$$i@\\(.*\\)\\.service/\\1/p" ...

The parser was complaining about the backslashes. Really, it is not a big deal to escape backslashes, it's just that this should be documented.

And it is still unclear why the parser would both complain about and also "fix" the escaped backslashes. That doesn't seem to make any sense. If it was "fixed", then why complain?

@poettering poettering added documentation needs-better-log-message and removed needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer labels Nov 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants