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

hook failed: "install" when failing to access Redfish #93

Closed
sagittariuslee opened this issue Nov 8, 2023 · 2 comments · Fixed by #110
Closed

hook failed: "install" when failing to access Redfish #93

sagittariuslee opened this issue Nov 8, 2023 · 2 comments · Fixed by #110
Labels
bug Something isn't working
Milestone

Comments

@sagittariuslee
Copy link

Detail logs:

2023-11-08 13:12:09 ERROR juju.worker.uniter.operation runhook.go:140 hook "install" (via hook dispatching script: dispatch) failed: exit status 1
2023-11-08 13:12:09 INFO juju.worker.uniter resolver.go:145 awaiting error resolution for "install" hook
2023-11-08 13:12:50 INFO juju.worker.uniter resolver.go:145 awaiting error resolution for "install" hook
2023-11-08 13:12:55 INFO unit.hardware-observer/18.juju-log server.go:316 Running legacy hooks/install.
2023-11-08 13:12:57 INFO unit.hardware-observer/18.juju-log server.go:316 Attempt 1 of /redfish/v1/
2023-11-08 13:12:57 INFO unit.hardware-observer/18.juju-log server.go:316 Response Time for GET to /redfish/v1/: 0.3068226813338697 seconds.
2023-11-08 13:12:57 ERROR unit.hardware-observer/18.juju-log server.go:316 Uncaught exception while in charm code:
Traceback (most recent call last):
  File "./src/charm.py", line 173, in <module>
    ops.main(HardwareObserverCharm)  # type: ignore
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/main.py", line 451, in __call__
    return main(charm_class, use_juju_for_storage=use_juju_for_storage)
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/main.py", line 434, in main
    framework.reemit()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/framework.py", line 852, in reemit
    self._reemit()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/framework.py", line 931, in _reemit
    custom_handler(event)
  File "./src/charm.py", line 60, in _on_install_or_upgrade
    redfish_creds = self._get_redfish_creds()
  File "./src/charm.py", line 158, in _get_redfish_creds
    bmc_tools = bmc_hw_verifier()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/src/hw_tools.py", line 346, in bmc_hw_verifier
    if redfish_available():
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/src/hw_tools.py", line 317, in redfish_available
    redfish_obj = redfish_client(base_url=host, username="", password="")
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 1165, in redfish_client
    return HttpClient(base_url=base_url, username=username, password=password,
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 1073, in __init__
    super(HttpClient, self).__init__(base_url, username=username,
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 500, in __init__
    self.get_root_object()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 595, in get_root_object
    raise ServerDownOrUnreachableError("Server not reachable, " \
redfish.rest.v1.ServerDownOrUnreachableError: Server not reachable, return code: 500
2023-11-08 13:12:57 ERROR juju.worker.uniter.operation runhook.go:140 hook "install" (via hook dispatching script: dispatch) failed: exit status 1
2023-11-08 13:12:57 INFO juju.worker.uniter resolver.go:145 awaiting error resolution for "install" hook
2023-11-08 13:14:20 INFO juju.worker.uniter resolver.go:145 awaiting error resolution for "install" hook
2023-11-08 13:14:21 INFO unit.hardware-observer/18.juju-log server.go:316 Running legacy hooks/install.
2023-11-08 13:14:22 INFO unit.hardware-observer/18.juju-log server.go:316 Attempt 1 of /redfish/v1/
2023-11-08 13:14:22 INFO unit.hardware-observer/18.juju-log server.go:316 Response Time for GET to /redfish/v1/: 0.33143501402810216 seconds.
2023-11-08 13:14:22 ERROR unit.hardware-observer/18.juju-log server.go:316 Uncaught exception while in charm code:
Traceback (most recent call last):
  File "./src/charm.py", line 173, in <module>
    ops.main(HardwareObserverCharm)  # type: ignore
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/main.py", line 451, in __call__
    return main(charm_class, use_juju_for_storage=use_juju_for_storage)
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/main.py", line 434, in main
    framework.reemit()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/framework.py", line 852, in reemit
    self._reemit()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/framework.py", line 931, in _reemit
    custom_handler(event)
  File "./src/charm.py", line 60, in _on_install_or_upgrade
    redfish_creds = self._get_redfish_creds()
  File "./src/charm.py", line 158, in _get_redfish_creds
    bmc_tools = bmc_hw_verifier()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/src/hw_tools.py", line 346, in bmc_hw_verifier
    if redfish_available():
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/src/hw_tools.py", line 317, in redfish_available
    redfish_obj = redfish_client(base_url=host, username="", password="")
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 1165, in redfish_client
    return HttpClient(base_url=base_url, username=username, password=password,
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 1073, in __init__
    super(HttpClient, self).__init__(base_url, username=username,
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 500, in __init__
    self.get_root_object()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 595, in get_root_object
    raise ServerDownOrUnreachableError("Server not reachable, " \
redfish.rest.v1.ServerDownOrUnreachableError: Server not reachable, return code: 500
2023-11-08 13:14:22 ERROR juju.worker.uniter.operation runhook.go:140 hook "install" (via hook dispatching script: dispatch) failed: exit status 1
2023-11-08 13:14:22 INFO juju.worker.uniter resolver.go:145 awaiting error resolution for "install" hook
2023-11-08 13:17:10 INFO juju.worker.uniter resolver.go:145 awaiting error resolution for "install" hook
2023-11-08 13:17:10 INFO unit.hardware-observer/18.juju-log server.go:316 Running legacy hooks/install.
2023-11-08 13:17:11 INFO unit.hardware-observer/18.juju-log server.go:316 Attempt 1 of /redfish/v1/
2023-11-08 13:17:12 INFO unit.hardware-observer/18.juju-log server.go:316 Response Time for GET to /redfish/v1/: 0.3288719221018255 seconds.
2023-11-08 13:17:12 ERROR unit.hardware-observer/18.juju-log server.go:316 Uncaught exception while in charm code:
Traceback (most recent call last):
  File "./src/charm.py", line 173, in <module>
    ops.main(HardwareObserverCharm)  # type: ignore
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/main.py", line 451, in __call__
    return main(charm_class, use_juju_for_storage=use_juju_for_storage)
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/main.py", line 434, in main
    framework.reemit()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/framework.py", line 852, in reemit
    self._reemit()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/ops/framework.py", line 931, in _reemit
    custom_handler(event)
  File "./src/charm.py", line 60, in _on_install_or_upgrade
    redfish_creds = self._get_redfish_creds()
  File "./src/charm.py", line 158, in _get_redfish_creds
    bmc_tools = bmc_hw_verifier()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/src/hw_tools.py", line 346, in bmc_hw_verifier
    if redfish_available():
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/src/hw_tools.py", line 317, in redfish_available
    redfish_obj = redfish_client(base_url=host, username="", password="")
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 1165, in redfish_client
    return HttpClient(base_url=base_url, username=username, password=password,
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 1073, in __init__
    super(HttpClient, self).__init__(base_url, username=username,
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 500, in __init__
    self.get_root_object()
  File "/var/lib/juju/agents/unit-hardware-observer-18/charm/venv/redfish/rest/v1.py", line 595, in get_root_object
    raise ServerDownOrUnreachableError("Server not reachable, " \
redfish.rest.v1.ServerDownOrUnreachableError: Server not reachable, return code: 500
2023-11-08 13:17:12 ERROR juju.worker.uniter.operation runhook.go:140 hook "install" (via hook dispatching script: dispatch) failed: exit status 1
2023-11-08 13:17:12 INFO juju.worker.uniter resolver.go:145 awaiting error resolution for "install" hook
2023-11-08 13:19:23 INFO juju.worker.uniter resolver.go:145 awaiting error resolution for "install" hook

=========curl from the host===============================

~$ curl -k -D - -X POST 'https://10.101.11.162/redfish/v1/SessionService/Sessions' \
> -H "Content-Type: application/json" -d '{ "UserName": "", "Password": "" }'
HTTP/1.1 500 
Date: Wed, 08 Nov 2023 13:57:14 GMT
Server: webserver
Content-Type: application/json
Content-Length: 319
Connection: close

{
	"error":	{
		"code":	"Base.1.4.0.GeneralError",
		"message":	"See ExtendedInfo for more information.",
		"@Message.ExtendedInfo":	[{
				"@odata.type":	"#Message.v1_1_1.Message",
				"MessageId":	"Base.1.4.0.InternalError",
				"Message":	"Access Denied",
				"MessageArgs":	[],
				"Severity":	"Critical"
			}]
	}
}
@Pjack Pjack added the bug Something isn't working label Nov 9, 2023
@chanchiwai-ray
Copy link
Contributor

Is this related to a proxy issue or something else?

@sagittariuslee
Copy link
Author

no. I don't think it is related to proxy or something else..

@Pjack Pjack added this to the 23.10.1 milestone Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants