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

unhandled Python exception in '/usr/bin/targetd' #35

Closed
SteffanCline opened this issue Jan 4, 2020 · 3 comments · Fixed by #38
Closed

unhandled Python exception in '/usr/bin/targetd' #35

SteffanCline opened this issue Jan 4, 2020 · 3 comments · Fixed by #38

Comments

@SteffanCline
Copy link

SteffanCline commented Jan 4, 2020

In trying to figure out an issue with targetcli, I was told I needed targetd to be installed and running. I did that and rebooted but came across errors in the log about the root password not being set in the config file. CRITICAL:root:password not set in /etc/target/targetd.yaml I went ahead and populated that but now came across this:

master python3 -s /usr/bin/targetd[1437]: detected unhandled Python exception in '/usr/bin/targetd'
master targetd[1437]: Traceback (most recent call last):
master targetd[1437]: File "/usr/bin/targetd", line 24, in <module>
master targetd[1437]: sys.exit(main())
master targetd[1437]: File "/usr/lib/python3.7/site-packages/targetd/main.py", line 258, in main
master targetd[1437]: load_config(default_config_path)
master targetd[1437]: File "/usr/lib/python3.7/site-packages/targetd/main.py", line 210, in load_config
master targetd[1437]: config[key] = value
master targetd[1437]: TypeError: 'str' object does not support item assignment
master systemd[1]: targetd.service: Main process exited, code=exited, status=1/FAILURE
master systemd[1]: targetd.service: Failed with result 'exit-code'.

Currently using targetd.noarch 0.8.9-1.fc31

Any suggestions?

EDIT: I put a space between the colon and the password. That seemed to help. Then I had to add in block_pools: [] just to get it to start, at least it seems it's started. Is this the normal? Is that part completely manual or does targetcli add that in?

@tasleson
Copy link
Member

tasleson commented Jan 5, 2020

You don't need targetd for targetcli. You likely want target-restore to go with target-cli though.

Targetd is a daemon to allow remote storage configuration of a system, to make it into a storage appliance.

It does appear we should add more robust handling of the targetd configuration file, to avoid the exceptions you are hitting in the yaml.

@SteffanCline
Copy link
Author

Ok, thank you for the prompt response.

tasleson added a commit to tasleson/targetd that referenced this issue Feb 25, 2020
If a user doesn't place a space between the ':' and the
password we simply get a string returned back from the yaml parse.

In this case we will ensure that the returned value is not none and
not simply a string.  Perhaps there is a better way to handle this?

Ref. open-iscsi#35

Signed-off-by: Tony Asleson <tasleson@redhat.com>
@tasleson tasleson mentioned this issue Feb 25, 2020
@tasleson
Copy link
Member

tasleson commented Feb 25, 2020

This specific bad password format addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants