juju-gui hangs on "Connecting to the Juju environment"

Bug #1542652 reported by smartbit
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
juju-gui
Fix Released
High
Brad Crittenden

Bug Description

Exactly followed vagrant on OSX https://jujucharms.com/docs/devel/config-vagrant and am not able to connect to the juju gui.
Seemingly tries to connect to 10.0.2.15 (see attachement).

Please help me out, been trying to get juju working for 3 days now without succes, Bart

No certificate involved as
$juju set juju-gui secure=false
WARNING the configuration setting "secure" already has the value "false"

Added the route, at no avail.
$ sudo route add -net 10.0.2.0/24 172.16.250.15
$ netstat -nr | grep 10.0
10.0.2/24 172.16.250.15 UGSc 0 0 vboxnet
10.0.3/24 172.16.250.15 UGSc 0 0 vboxnet

$ vboxmanage -v
5.0.14r105127

$ vagrant version
Installed Version: 1.8.1
Latest Version: 1.8.1

$$ vboxmanage list runningvms -l | grep NIC
NIC 1: MAC: 0800273B7712, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 1 Rule(0): name = ssh, protocol = tcp, host ip = 127.0.0.1, host port = 2222, guest ip = , guest port = 22
NIC 1 Rule(1): name = tcp2122, protocol = tcp, host ip = 127.0.0.1, host port = 2122, guest ip = , guest port = 22
NIC 1 Rule(2): name = tcp6079, protocol = tcp, host ip = 127.0.0.1, host port = 6079, guest ip = , guest port = 6079
NIC 1 Rule(3): name = tcp6080, protocol = tcp, host ip = 127.0.0.1, host port = 6080, guest ip = , guest port = 80
NIC 2: MAC: 080027257B3E, Attachment: Host-only Interface 'vboxnet9', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none

$ vagrant ssh
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-77-generic x86_64)

 * Documentation: https://help.ubuntu.com/

  System information as of Sat Feb 6 13:05:06 UTC 2016

  System load: 0.09 Users logged in: 0
  Usage of /: 34.6% of 7.48GB IP address for eth0: 10.0.2.15
  Memory usage: 13% IP address for eth1: 172.16.250.15
  Swap usage: 0% IP address for lxcbr0: 10.0.3.1
  Processes: 147

  => There is 1 zombie process.

  Graph this data and manage this system at:
    https://landscape.canonical.com/

This is a customized Ubuntu Server Cloud Image for use Juju demonstration
and Juju development within the Vagrant Development environment.

For more information about, see the following links:
      Juju: https://juju.ubuntu.com/
      Vagrant: htp://www.vagrantbox.es/

Support notice: These images are provided as-is without warranty, support
      or representation of any fitness whatsoever. These images are
      are for demonstration and developement, but should not be used
      for any production purpouses.

SECURITY NOTICE: These images contain the well-known Vagrant public
      SSH key. This means that these images are insecure for SSH.

Juju GUI: To access the Juju GUI, point your browser at:
      http://127.0.0.1:6079
      Username: admin
      Password: +JybQVVt

vagrant@vagrant-ubuntu-trusty-64:~$ juju version
1.25.3-trusty-amd64

vagrant@vagrant-ubuntu-trusty-64:~$ juju get juju-gui
charm: juju-gui
service: juju-gui
settings:
  builtin-server-logging:
    default: true
    description: |
      Set the GUI server log level. Possible values are debug, info, warning
      and error. The log file is placed in /var/log/upstart/guiserver.log.
    type: string
    value: info
  cached-fonts:
    default: true
    description: |
      Configure the GUI to use locally cached fonts, rather than the Google CDN
      as supplied by the Google fonts API. The CDN is faster in almost every
      circumstance except local (LXC) environments, and so it is the default;
      but if a browser is running the GUI on a closed network, using cached
      fonts will let the GUI load much faster and render properly.
    type: boolean
    value: false
  charmstore-url:
    default: true
    description: |
      The URL of the charm store API service. This option supersedes the
      charmworld-url option above.
    type: string
    value: https://api.jujucharms.com/charmstore/
  charmworld-url:
    default: true
    description: |
      The URL of the charm catalog site ("charmworld") from which charm
      catalog data will be drawn.
    type: string
    value: https://manage.jujucharms.com/
  command-log-file:
    default: true
    description: |
      The log file where stdout and stderr should be sent for all commands
      that are run by charm hooks.
    type: string
    value: /var/log/juju/juju-gui.log
  gtm-enabled:
    default: true
    description: |
      Enables Google tag manager tracking.
    type: boolean
    value: false
  gzip-compression:
    default: true
    description: |
      Enables gzip compressed responses from the gui.
    type: boolean
    value: true
  hide-login-button:
    default: true
    description: |
      There are deployment modes for Juju GUI which are not intended as regular
      use mode. In these cases, login/logout are disabled and instead there is
      a link to jujucharms.com.
    type: boolean
    value: false
  interactive-login:
    default: true
    description: |
      Enables interactive login to an identity-manager, if applicable.
    type: boolean
    value: false
  jem-location:
    default: true
    description: Publicly accessible URL of a Juju Environment Manager.
    type: string
    value: ""
  juju-core-version:
    default: true
    description: |
      The version of Juju tools used for the charm deployment. If left empty,
      the Juju version is dynamically retrieved.
    type: string
  juju-gui-console-enabled:
    default: true
    description: |
      Whether or not the console should be enabled for the browser.
    type: boolean
    value: false
  juju-gui-debug:
    default: true
    description: |
      Run Juju GUI in debug mode, serving the uncompressed GUI source files.
    type: boolean
    value: false
  login-help:
    description: |
      The help text shown to the user on the login screen. If not provided, a
      default message is used, suggesting how to find the login credentials.
    type: string
    value: |2-

      Welcome to the Juju Quick Start GUI!

      This is a private instance of Juju GUI accessable only to your local
      machine. NOTE: This Juju GUI installation is for demonstration,
      development and other non-production uses.

      Your Password is: +JybQVVt
  nagios_context:
    default: true
    description: |
      Used by the nrpe-external-master subordinate charm.
      A string that will be prepended to instance name to set the host name
      in nagios. So for instance the hostname would be something like:
          juju-myservice-0
      If you are running multiple environments with the same services in them
      this allows you to differentiate between them.
    type: string
    value: juju
  password:
    default: true
    description: |
      If given, the password to use for the environment to immediately
      connect. Do not set unless you understand and accept the risks.
    type: string
  port:
    default: true
    description: |
      Supply a different port to host the GUI on besides the default 80 and
      443. If the provided port is not a valid TCP port (ranging from 1 to
      65535) the defaults are used.
    type: int
  read-only:
    default: true
    description: |
      Whether or not the GUI is in read-only mode. Note that read-only mode is
      advisory, and enforced only in the client. If someone can access the
      websocket and has the password, they can send commands over the
      websocket to mutate the environment.
    type: boolean
    value: false
  repository-location:
    default: true
    description: |
      The charm depends on several software packages that are not packaged in
      Ubuntu. In order to ensure that only versions known to work with our
      charm are used, there is a single PPA where all packages are kept. The
      juju-gui-charmers team supports 'stable' and 'devel' versions. Only
      stable should be used for production. For enterprise deployments that
      do not allow access to resources outside of their control, the location
      can be any specification as long as it is recognizable by
      'add-apt-repository'.
    type: string
    value: ppa:juju-gui-charmers/stable
  sandbox:
    default: true
    description: |
      Run using an in-memory sandbox rather than a real Juju backend. Sandbox
      is a client side construct running entirely in the client. Sandbox does
      not currently support imported environment simulation.
    type: boolean
    value: false
  secure:
    description: |
      Set to false to serve the GUI over an insecure HTTP connection.
      Do not set unless you understand and accept the risks.
    type: boolean
    value: false
  serve-tests:
    default: true
    description: |
      Whether or not the GUI unit tests are exposed. If this option is
      enabled, unit tests can be run in the browser by visiting the URL
      "https://[Juju GUI address]/test/".
    type: boolean
    value: false
  ssl-cert-contents:
    default: true
    description: |
      The contents of the certificate file to be used in SSL connections to
      the GUI. Both ssl-cert-contents and ssl-key-contents must be provided.
      If not, cetificates will be automatically generated.
    type: string
  ssl-cert-path:
    default: true
    description: |
      The path to the directory where the SSL certificates are stored.
    type: string
    value: /etc/ssl/juju-gui
  ssl-key-contents:
    default: true
    description: |
      The contents of the private key file to be used in SSL connections to
      the GUI. Both ssl-cert-contents and ssl-key-contents must be provided.
      If not, cetificates will be automatically generated.
    type: string
  ws-secure:
    default: true
    description: |
      Force the client to use secure ("wss") or unsecure ("ws") WebSockets.
      If left unset, secure WebSockets are used based on the secure option: if
      secure is True the "wss" protocol is used, othewise the "ws" one is used.
    type: boolean
vagrant@vagrant-ubuntu-trusty-64:~$

Revision history for this message
smartbit (5j-ubuntu) wrote :
Revision history for this message
Brad Crittenden (bac) wrote :

Hi Bart I'm trying to reproduce your setup to see if I can replicate your problem. Thanks for the bug report.

Revision history for this message
Brad Crittenden (bac) wrote :

Bart I've been able to replicate your issue and will begin trying to diagnose it.

Changed in juju-gui:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
smartbit (5j-ubuntu) wrote :

Thanks, all the best. If I can be of any assistance, please let me know.
BTW I get the message "GuestAdditions versions on your host (5.0.14) and guest (5.0.10) do not match." or similar. The vagrant-vbguest plugin will upgrade the GuestAdditions to 5.0.14.

Also these fail connection to 127.0.0.1:6080 (or 6079):
vagrant init ubuntu/trusty64-juju; vagrant up --provider virtualbox
vagrant init ubuntu/wily64-juju; vagrant up --provider virtualbox

Revision history for this message
Brad Crittenden (bac) wrote :

In views.py the socket_protocol is hard-coded to 'wss' but the services started by vagrant is in 'insecure mode' so it should be 'ws'. The setting for socket_protocol should be a dynamic setting based on the setting of insecure mode.

Add a test for insecure mode.

Changed in juju-gui:
importance: Medium → High
Brad Crittenden (bac)
Changed in juju-gui:
assignee: nobody → Brad Crittenden (bac)
Revision history for this message
Brad Crittenden (bac) wrote :

A fix to the juju gui has been released (v2.0.2) to address this problem. It works for me now. Please verify you can connect.

When prompted, enter 'admin' as the user and the password printed in the vagrant window.

Changed in juju-gui:
status: Triaged → Fix Released
Revision history for this message
smartbit (5j-ubuntu) wrote :

Fixed for https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-juju-vagrant-disk1.box
http://127.0.0.1:6079/version shows "version": "2.0.3"

Description for ws-secure seems not to be boolean, but having three states True, False and Unset. I suggest something like this
ws-secure:
    default: Unset
    description: |
      Force the client to use secure ("wss") or unsecure ("ws") WebSockets.
      If left unset, secure WebSockets are used based on the secure option: if
      secure is True the "wss" protocol is used, othewise the "ws" one is used.
    type: trivalent, ternary, or trilean

Revision history for this message
Jeff Pihach (hatch) wrote :

Hi, this configuration option will be removed in the near future entirely and the GUI will only be able to be served over https and wss.

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.