You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ambari.apache.org by Lian Jiang <ji...@gmail.com> on 2018/01/30 16:13:09 UTC

ambari-shell throw "Cannot get property 'items' on null object"

Hi,

I am using ambari-shell docker (
http://blog.sequenceiq.com/blog/2014/05/26/ambari-shell/). However,

docker run -it --rm sequenceiq/ambari-shell --ambari.host=localhost
--ambari.port=8080

threw error "Cannot get property 'items' on null object" even I can use
ambari web UI to sign in localhost:8080 using admin/admin.

Any idea will be highly appreciated!

Re: ambari-shell throw "Cannot get property 'items' on null object"

Posted by Lian Jiang <ji...@gmail.com>.
Thanks for reply.

I did below:

1. get ip of the host.

sudo ip addr show docker0
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue
state DOWN
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 172.17.42.1/16 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::2cd2:3ff:fec4:809d/64 scope link
       valid_lft forever preferred_lft forever

2. use below command to invoke docker:

sudo docker run -it --rm sequenceiq/ambari-shell --network="host"
--ambari.host=172.17.42.1 --ambari.port=8080

The new error I got:
Cannot connect to Ambari http://172.17.42.1:8080/api/v1/

Any idea? Thanks.

On Tue, Jan 30, 2018 at 12:04 PM, Doroszlai, Attila <ad...@apache.org>
wrote:

> Hi Lian,
>
> localhost in the docker container is not the same as localhost on your
> own computer.  The address where the container can talk to your
> computer depends on the networking mode and OS.  See
> https://stackoverflow.com/questions/24319662/from-
> inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach
> for examples.
>
> -Attila
>
> On Tue, Jan 30, 2018 at 5:13 PM, Lian Jiang <ji...@gmail.com> wrote:
> > Hi,
> >
> > I am using ambari-shell docker
> > (http://blog.sequenceiq.com/blog/2014/05/26/ambari-shell/). However,
> >
> > docker run -it --rm sequenceiq/ambari-shell --ambari.host=localhost
> > --ambari.port=8080
> >
> > threw error "Cannot get property 'items' on null object" even I can use
> > ambari web UI to sign in localhost:8080 using admin/admin.
> >
> > Any idea will be highly appreciated!
>

Re: ambari-shell throw "Cannot get property 'items' on null object"

Posted by "Doroszlai, Attila" <ad...@apache.org>.
Hi Lian,

localhost in the docker container is not the same as localhost on your
own computer.  The address where the container can talk to your
computer depends on the networking mode and OS.  See
https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach
for examples.

-Attila

On Tue, Jan 30, 2018 at 5:13 PM, Lian Jiang <ji...@gmail.com> wrote:
> Hi,
>
> I am using ambari-shell docker
> (http://blog.sequenceiq.com/blog/2014/05/26/ambari-shell/). However,
>
> docker run -it --rm sequenceiq/ambari-shell --ambari.host=localhost
> --ambari.port=8080
>
> threw error "Cannot get property 'items' on null object" even I can use
> ambari web UI to sign in localhost:8080 using admin/admin.
>
> Any idea will be highly appreciated!