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

AttributeError: 'Localhost' object has no attribute 'lxd_bin' #1464

Closed
battlemidget opened this issue Jun 8, 2018 · 9 comments

Comments

@battlemidget
Copy link
Contributor

commented Jun 8, 2018

I updated my conjure-up to conjure-up 2.5.7-20180606.1806
On a conjure-up now I am even unable to run the installer.
As soon as I select Kubernetes Core, I am led to this error:
AttributeError: 'Localhost' object has no attribute 'lxd_bin'
Don't even get the option to choose a cloud.

2018-06-08 09:59:02,037 [DEBUG] conjure-up/kubernetes-core - utils.py:512 - Pulling bundle for kubernetes-core from channel: stable
2018-06-08 09:59:03,534 [DEBUG] conjure-up/kubernetes-core - gui.py:78 - Starting watcher for verifying LXD server is available.
2018-06-08 09:59:03,535 [DEBUG] conjure-up/kubernetes-core - telemetry.py:17 - Showing screen: Choose a Cloud
2018-06-08 09:59:03,538 [DEBUG] conjure-up/kubernetes-core - provider.py:355 - LXD environment set: binary /usr/bin/lxc lxd_dir /var/lib/lxd
2018-06-08 09:59:03,651 [DEBUG] conjure-up/kubernetes-core - provider.py:371 - LXD query cmd: /usr/bin/lxc query --wait /1.0
2018-06-08 09:59:03,671 [DEBUG] conjure-up/kubernetes-core - events.py:52 - Setting Error at conjureup/events.py:149
2018-06-08 09:59:03,674 [ERROR] conjure-up/kubernetes-core - events.py:161 - Unhandled exception in <Task finished coro=<CloudsController._monitor_localhost() done, defined at /snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/controllers/clouds/gui.py:85> exception=AttributeError("'Localhost' object has no attribute 'lxd_bin'",)>
Traceback (most recent call last):
  File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/models/provider.py", line 373, in query
    return json.loads(out)
  File "/snap/conjure-up/1006/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/snap/conjure-up/1006/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/snap/conjure-up/1006/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/controllers/clouds/gui.py", line 94, in _monitor_localhost
    server_compatible = await provider.is_server_compatible()
  File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/models/provider.py", line 418, in is_server_compatible
    out = await self.query()
  File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/models/provider.py", line 375, in query
    raise errors.LXDParseError(self.lxd_bin)
AttributeError: 'Localhost' object has no attribute 'lxd_bin'
2018-06-08 09:59:03,684 [DEBUG] conjure-up/kubernetes-core - __init__.py:29 - Showing dialog for exception: 'Localhost' object has no attribute 'lxd_bin'
2018-06-08 09:59:16,725 [DEBUG] conjure-up/kubernetes-core - events.py:52 - Setting Shutdown at conjureup/events.py:145
2018-06-08 09:59:16,726 [DEBUG] conjure-up/kubernetes-core - events.py:52 - Received Shutdown at conjureup/events.py:176
2018-06-08 09:59:16,726 [INFO] conjure-up/kubernetes-core - events.py:180 - Shutting down

Brought over from #1462

@battlemidget battlemidget self-assigned this Jun 8, 2018

battlemidget added a commit that referenced this issue Jun 8, 2018

Remove serializing app_config to file
We only serialize the Conjurefile and stores it in extra-info if juju
exist. (This could be expanded on later to account for snap spell types)

Fixes #1464

Signed-off-by: Adam Stokes <battlemidget@users.noreply.github.com>

battlemidget added a commit that referenced this issue Jun 8, 2018

Fixes #1464
Signed-off-by: Adam Stokes <battlemidget@users.noreply.github.com>

@johnsca johnsca closed this in 0fce684 Jun 8, 2018

@bawdipoonch

This comment has been minimized.

Copy link

commented Jun 10, 2018

I'm getting the same issue in conjure-up upon selecting kuberenetes core.
Is there any way to resolve this? I see that you have committed the fix, but how can get that in my local installation of conjure-up ?
Version: 2.5.7-20180606.1806

Error Log:

2018-06-10 10:02:52,665 [DEBUG] conjure-up/_unspecified_spell - juju.py:35 - bin_path candidate found
2018-06-10 10:02:52,668 [DEBUG] conjure-up/_unspecified_spell - juju.py:35 - wait_path candidate found
2018-06-10 10:02:54,722 [DEBUG] conjure-up/_unspecified_spell - app.py:279 - Juju version: 2.3.8-bionic-amd64, conjure-up version: 2.5.7
2018-06-10 10:02:54,756 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:17 - Showing screen: Application Start
2018-06-10 10:02:54,762 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:31 - OS: Linux-4.15.0-20-generic-x86_64-with-debian-buster-sid
2018-06-10 10:02:54,777 [INFO] conjure-up/_unspecified_spell - events.py:173 - Watching for shutdown
2018-06-10 10:02:55,008 [DEBUG] conjure-up/_unspecified_spell - events.py:52 - Awaiting Shutdown at conjureup/events.py:176
2018-06-10 10:02:55,058 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:17 - Showing screen: Spell Selection
2018-06-10 10:02:57,330 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:31 - Spell Choice: kubernetes-core
2018-06-10 10:02:57,339 [DEBUG] conjure-up/kubernetes-core - download.py:60 - Path is local filesystem, copying /snap/conjure-up/1006/spells/kubernetes-core to /home/vaibhav/.cache/conjure-up/kubernetes-core
2018-06-10 10:02:57,623 [DEBUG] conjure-up/kubernetes-core - step.py:27 - steps: [<StepModel Kubernetes Core 00_process-providertype v: False c: []>, <StepModel Kubernetes Core 01_select-network v: True c: []>, <StepModel Kubernetes Core 02_get-kubectl v: True c: []>, <StepModel Kubernetes Core 03_cluster-info v: True c: []>, <StepModel Kubernetes Core 04_enable-cni v: False c: []>]
2018-06-10 10:02:57,624 [DEBUG] conjure-up/kubernetes-core - utils.py:512 - Pulling bundle for kubernetes-core from channel: stable
2018-06-10 10:03:00,935 [DEBUG] conjure-up/kubernetes-core - gui.py:78 - Starting watcher for verifying LXD server is available.
2018-06-10 10:03:00,936 [DEBUG] conjure-up/kubernetes-core - telemetry.py:17 - Showing screen: Choose a Cloud
2018-06-10 10:03:00,952 [DEBUG] conjure-up/kubernetes-core - provider.py:355 - LXD environment set: binary /snap/bin/lxc lxd_dir /var/snap/lxd/common/lxd
2018-06-10 10:03:01,298 [DEBUG] conjure-up/kubernetes-core - provider.py:371 - LXD query cmd: /snap/bin/lxc query --wait /1.0
2018-06-10 10:03:01,438 [DEBUG] conjure-up/kubernetes-core - events.py:52 - Setting Error at conjureup/events.py:149
2018-06-10 10:03:01,446 [ERROR] conjure-up/kubernetes-core - events.py:161 - Unhandled exception in <Task finished coro=<CloudsController._monitor_localhost() done, defined at /snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/controllers/clouds/gui.py:85> exception=AttributeError("'Localhost' object has no attribute 'lxd_bin'",)>
Traceback (most recent call last):
File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/models/provider.py", line 373, in query
return json.loads(out)
File "/snap/conjure-up/1006/usr/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/snap/conjure-up/1006/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/snap/conjure-up/1006/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/controllers/clouds/gui.py", line 94, in _monitor_localhost
server_compatible = await provider.is_server_compatible()
File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/models/provider.py", line 418, in is_server_compatible
out = await self.query()
File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/models/provider.py", line 375, in query
raise errors.LXDParseError(self.lxd_bin)
AttributeError: 'Localhost' object has no attribute 'lxd_bin'
2018-06-10 10:03:01,479 [DEBUG] conjure-up/kubernetes-core - init.py:29 - Showing dialog for exception: 'Localhost' object has no attribute 'lxd_bin'
2018-06-10 10:03:18,865 [DEBUG] conjure-up/kubernetes-core - events.py:52 - Setting Shutdown at conjureup/events.py:145
2018-06-10 10:03:18,869 [DEBUG] conjure-up/kubernetes-core - events.py:52 - Received Shutdown at conjureup/events.py:176
2018-06-10 10:03:18,870 [INFO] conjure-up/kubernetes-core - events.py:180 - Shutting down
2018-06-10 10:03:22,950 [DEBUG] conjure-up/_unspecified_spell - juju.py:35 - bin_path candidate found
2018-06-10 10:03:22,952 [DEBUG] conjure-up/_unspecified_spell - juju.py:35 - wait_path candidate found
2018-06-10 10:03:23,215 [DEBUG] conjure-up/_unspecified_spell - app.py:279 - Juju version: 2.3.8-bionic-amd64, conjure-up version: 2.5.7
2018-06-10 10:03:23,247 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:17 - Showing screen: Application Start
2018-06-10 10:03:23,253 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:31 - OS: Linux-4.15.0-20-generic-x86_64-with-debian-buster-sid
2018-06-10 10:03:23,266 [INFO] conjure-up/_unspecified_spell - events.py:173 - Watching for shutdown
2018-06-10 10:03:23,416 [DEBUG] conjure-up/_unspecified_spell - events.py:52 - Awaiting Shutdown at conjureup/events.py:176
2018-06-10 10:03:23,487 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:17 - Showing screen: Spell Selection
2018-06-10 10:03:25,918 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:31 - Spell Choice: canonical-kubernetes
2018-06-10 10:03:25,963 [DEBUG] conjure-up/canonical-kubernetes - download.py:60 - Path is local filesystem, copying /snap/conjure-up/1006/spells/canonical-kubernetes to /home/vaibhav/.cache/conjure-up/canonical-kubernetes
2018-06-10 10:03:26,262 [DEBUG] conjure-up/canonical-kubernetes - step.py:27 - steps: [<StepModel Canonical Distribution of Kubernetes 00_process-providertype v: False c: []>, <StepModel Canonical Distribution of Kubernetes 01_select-network v: True c: []>, <StepModel Canonical Distribution of Kubernetes 02_get-kubectl v: True c: []>, <StepModel Canonical Distribution of Kubernetes 03_cluster-info v: True c: []>, <StepModel Canonical Distribution of Kubernetes 04_enable-cni v: False c: []>]
2018-06-10 10:03:26,764 [DEBUG] conjure-up/canonical-kubernetes - utils.py:512 - Pulling bundle for canonical-kubernetes from channel: stable
2018-06-10 10:03:28,417 [DEBUG] conjure-up/canonical-kubernetes - telemetry.py:17 - Showing screen: Add-on Selection
2018-06-10 10:03:46,877 [DEBUG] conjure-up/canonical-kubernetes - telemetry.py:31 - Addon Selected: graylog
2018-06-10 10:03:46,878 [DEBUG] conjure-up/canonical-kubernetes - telemetry.py:31 - Addon Selected: helm
2018-06-10 10:03:46,886 [DEBUG] conjure-up/canonical-kubernetes - telemetry.py:31 - Addon Selected: jfrog
2018-06-10 10:03:46,887 [DEBUG] conjure-up/canonical-kubernetes - utils.py:512 - Pulling bundle for canonical-kubernetes from channel: stable
2018-06-10 10:03:49,814 [DEBUG] conjure-up/canonical-kubernetes - gui.py:78 - Starting watcher for verifying LXD server is available.
2018-06-10 10:03:49,816 [DEBUG] conjure-up/canonical-kubernetes - telemetry.py:17 - Showing screen: Choose a Cloud
2018-06-10 10:03:49,822 [DEBUG] conjure-up/canonical-kubernetes - provider.py:355 - LXD environment set: binary /snap/bin/lxc lxd_dir /var/snap/lxd/common/lxd
2018-06-10 10:03:49,947 [DEBUG] conjure-up/canonical-kubernetes - provider.py:371 - LXD query cmd: /snap/bin/lxc query --wait /1.0
2018-06-10 10:03:50,064 [DEBUG] conjure-up/canonical-kubernetes - events.py:52 - Setting Error at conjureup/events.py:149
2018-06-10 10:03:50,075 [ERROR] conjure-up/canonical-kubernetes - events.py:161 - Unhandled exception in <Task finished coro=<CloudsController._monitor_localhost() done, defined at /snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/controllers/clouds/gui.py:85> exception=AttributeError("'Localhost' object has no attribute 'lxd_bin'",)>
Traceback (most recent call last):
File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/models/provider.py", line 373, in query
return json.loads(out)
File "/snap/conjure-up/1006/usr/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/snap/conjure-up/1006/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/snap/conjure-up/1006/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/controllers/clouds/gui.py", line 94, in _monitor_localhost
server_compatible = await provider.is_server_compatible()
File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/models/provider.py", line 418, in is_server_compatible
out = await self.query()
File "/snap/conjure-up/1006/lib/python3.6/site-packages/conjureup/models/provider.py", line 375, in query
raise errors.LXDParseError(self.lxd_bin)
AttributeError: 'Localhost' object has no attribute 'lxd_bin'
2018-06-10 10:03:50,135 [DEBUG] conjure-up/canonical-kubernetes - init.py:29 - Showing dialog for exception: 'Localhost' object has no attribute 'lxd_bin'
2018-06-10 10:03:54,251 [DEBUG] conjure-up/canonical-kubernetes - events.py:52 - Setting Shutdown at conjureup/events.py:145
2018-06-10 10:03:54,256 [DEBUG] conjure-up/canonical-kubernetes - events.py:52 - Received Shutdown at conjureup/events.py:176
2018-06-10 10:03:54,256 [INFO] conjure-up/canonical-kubernetes - events.py:180 - Shutting down

@ColumGaynor

This comment has been minimized.

Copy link

commented Jun 10, 2018

@battlemidget : Having same problem with conjure-up.
Version: conjure-up 2.5.8-20180608.1706 1008 edge canonical classic
running on Ubuntu 18.04. How to get your latest fix please ? Tried snap refresh but error still present.
Thanks in advance. This is very exciting functionality once this minor glitch is fixed!
Regards Colum

@aadhiyogi

This comment has been minimized.

Copy link

commented Jun 12, 2018

I have the same issue on Ubuntu Server 18.04 LTS and conjure-up 2.5.7 (classic channel). Please suggest how to fix this. Would you recommend using Stable channel of conjure-up instead?

@battlemidget

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

Can you try sudo snap refresh conjure-up --edge

@PeterDavidCarter

This comment has been minimized.

Copy link

commented Jun 12, 2018

@battlemidget sudo snap refresh conjure-up --edge results in alternative error:

'NoneType' object has no attribute 'spell_type'
@battlemidget

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

Thanks I'll get that sorted @PeterDavidCarter

@battlemidget

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2018

It's fixed in this branch https://github.com/conjure-up/conjure-up/tree/feature/snap-spell-type, waiting on reviews before merging

@aadhiyogi

This comment has been minimized.

Copy link

commented Jun 13, 2018

@battlemidget while trying with sudo snap refresh conjure-up --edge getting the following: Unable to parse JSON output from LXD, does /snap/bin/lxc query --wait -X GET /1.0 return info about the LXD server?

note: I am able to successfully spin a lxd container after installing LXD

@battlemidget

This comment has been minimized.

Copy link
Contributor Author

commented Jun 13, 2018

Please open a new bug

@conjure-up conjure-up locked and limited conversation to collaborators Jun 13, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.