juju-log vs. command line length limits

Bug #1274460 reported by Stuart Bishop
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Expired
Medium
Unassigned
juju-core
Won't Fix
Medium
Unassigned

Bug Description

juju-log currently requires the log message to be passed on the command line. This means that hooks can unexpectedly fail if they manage to exceed the maximum command line length.

This problem could be worked around if juju-log was able to read in the log message from stdin. This would also be useful in other situations too:

./long-running-task 2> >(juju-log -l ERROR --pipe 1>&2) > >(juju-log -l DEBUG --pipe)

Curtis Hovey (sinzui)
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
tags: added: juju-log
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Not only that, if you have something like this:
"""
output=$(some command)
# output has "-e: option unknown"
juju-log "$output"
"""

juju-log won't log the output, but an error of its own (since it doesn't know the -e option).

Changed in juju-core:
importance: High → Medium
Revision history for this message
Eric Snow (ericsnowcurrently) wrote :

For a similar issue with relation-set (and a possible solution), see lp:1437366.

Revision history for this message
Gui Bot (rick-harding+guibot) wrote :

Also true per email thread to the Juju list on action-set. I'd like to suggest we make this a generic bug for this whole pattern and identify all paths this can occur in and copy the file based approach used in the bug Eric links above in comment #2.

Revision history for this message
John A Meinel (jameinel) wrote :

Hi Gui-bot :)

Does juju-log support "--" so you can do:

juju-log -- "$output"
?

It would make pretty good sense to have juju log be able to read from stdin (output | juju-log -) or something similar.

Stuart Bishop (stub)
tags: added: canonical-is
Changed in juju:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 2.1.0
Changed in juju-core:
status: Triaged → Won't Fix
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.1-rc2 → none
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 5 years, so we're marking it Expired. If you believe this is incorrect, please update the status.

Changed in juju:
status: Triaged → Expired
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.