open-port: command not found

Akshat Jiwan Sharma akshatjiwan at
Mon Oct 23 03:09:24 UTC 2017

Thanks Andrew. Just one more question how does the open-port command behave
with respect to the  firewalls with cloud providers. Specifically I'm
asking in context of google cloud platform which by default only allows
port 80 and 443(IIRC). So after running this command will I have to adjust
firewall rules there as well?


On Mon, Oct 23, 2017 at 7:28 AM, Andrew Wilkins <
andrew.wilkins at> wrote:

> On Mon, Oct 23, 2017 at 4:20 AM Akshat Jiwan Sharma <akshatjiwan at>
> wrote:
>> HI,
>> I'm trying to manually expose a port on a juju machine. According to this
>> answer
>> <>
>> I should be able to do something like this:-
>>  juju run  "open-port 443" --all
>> However when I type this in my shell it throws an error
>> open-port: command not found
> The different between the command you're running, and the one on
> AskUbuntu, is that you're not passing --unit. When you pass --unit, it runs
> the command in the context of a unit on the machine. You must be running in
> the context of a unit to use "hook tools", such as open-port.
> I can verify that the application on this particular controller is already
>> exposed and it thus satisfies the requirement for running this command.
>> >"The port range will only be open while the application is exposed."
>> Can you help me understand what I'm doing wrong?
> Ports are managed on a per-unit basis, so you need to execute the "run"
> command against a unit or application, using --unit or --application
> respectively.
> Once you've run open-port, you'll need to run "juju expose <application>"
> for the ports to actually be opened up.
> Thanks,
>> Akshat
>> --
>> Juju mailing list
>> Juju at
>> Modify settings or unsubscribe at:
>> mailman/listinfo/juju
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Juju mailing list