gitosis-init error | Traceback (most recent call last) - python

Hy Guys i got some error while setting up gitosis, i think its some kind of not installed python dependencies
here is my output
git#ubuntu-server ~ % sudo -H -u git gitosis-init < /home/git/cs8898_windows7_21.07.2014.pub
Traceback (most recent call last):
File "/usr/local/bin/gitosis-init", line 9, in <module>
load_entry_point('gitosis==0.2', 'console_scripts', 'gitosis-init')()
File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/app.py", line 24, in run
return app.main()
File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/app.py", line 38, in main
self.handle_args(parser, cfg, options, args)
File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/init.py", line 121, in handle_args
user = ssh_extract_user(pubkey)
File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/init.py", line 39, in ssh_extract_user
raise InsecureSSHKeyUsername(repr(user))
gitosis.init.InsecureSSHKeyUsername: Username contains not allowed characters: '----'
Would be nice to get some hints, i will try it my selfe too

This error comes from gitosis/init.py#L34-L39:
def ssh_extract_user(pubkey):
_, user = pubkey.rsplit(None, 1)
if ssh.isSafeUsername(user):
return user
else:
raise InsecureSSHKeyUsername(repr(user))
That means the content of your pubilc key file isn't abcd...(long_key)...xxxxx= yourName, but includes at the end ----.
Sanitizes its content or regenerate your keys.

Related

Nmap scan a network range with subnet raises PortScannerError

I'm trying to scan a nmap with the 192.168.10.1/24 network, using Python 3.9.2, Nmap 7.80 and python-nmap 0.7.1
Code:
import nmap
nm = nmap.PortScanner()
result = nm.scan(hosts = '192.168.10.1/24')
print(result)
Error:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/nmap/nmap.py", line 369, in analyse_nmap_xml_scan
dom = ET.fromstring(self._nmap_last_output)
File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 1348, in XML
return parser.close()
xml.etree.ElementTree.ParseError: no element found: line 7, column 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/fypgroup02/Documents/test.py", line 4, in <module>
result = nm.scan(hosts = '192.168.10.1/24')
File "/usr/local/lib/python3.9/dist-packages/nmap/nmap.py", line 306, in scan
return self.analyse_nmap_xml_scan(
File "/usr/local/lib/python3.9/dist-packages/nmap/nmap.py", line 372, in analyse_nmap_xml_scan
raise PortScannerError(nmap_err)
nmap.nmap.PortScannerError: "nmap: Target.cc:503: void Target::stopTimeOutClock(const timeval*): Assertion `htn.toclock_running == true' failed.\n"
I have tried to scan 192.168.10.1-10, it works, but why is 192.168.10.1/24 not working?

Exeeuted in model using python on triton inference server getting issue json parser

python3 /home/ubuntu/Deepthi/triton-inference-server-master/src/clients/python/examples/image_client.py -m /home/ubuntu/Deepthi/triton-inference-server-master/docs/model_repository/resnet50_netdef/1 -s INCEPTION /home/ubuntu/Deepthi/triton-inference-server-master/qa/images/mug.jpg
Traceback (most recent call last):
File "/home/ubuntu/Deepthi/triton-inference-server-master/src/clients/python/examples/image_client.py", line 403, in <module>
model_name=FLAGS.model_name, model_version=FLAGS.model_version)
File "/home/ubuntu/.local/lib/python3.6/site-packages/tritonhttpclient/__init__.py", line 471, in get_model_metadata
_raise_if_error(response)
File "/home/ubuntu/.local/lib/python3.6/site-packages/tritonhttpclient/__init__.py", line 57, in _raise_if_error
error = _get_error(response)
File "/home/ubuntu/.local/lib/python3.6/site-packages/tritonhttpclient/__init__.py", line 46, in _get_error
error_response = json.loads(response.read())
rapidjson.JSONDecodeError: Parse error at offset 0: The document is empty.
I am not getting why I am getting this error, everything is ready .

How to solve "KeyError: 'cpu'" error when trying to generate configFileName.xml with Gem5toMcpat?

Hello I am trying to generate configFileName.xml by using the following command in Gem5toMcpat parser which is installed on ubuntu 20
python Program.py stats.txt config.json ARM_A9_2GHz.xml
but it showed me this error
Traceback (most recent call last):
File "Program.py", line 964, in <module>
main()
File "Program.py", line 38, in main
countCores(sys.argv[2])
File "Program.py", line 70, in countCores
noCores = len(configfile["system"]["cpu"])
KeyError: 'cpu'

Python code not working from cron job but works from command line via virtualenv

I am receiving different errors which I cannot determine the issue. It seems as though it has to do with the configparser.py NoSectionError(section). This code runs fine from the command line in the virtualenv.
Traceback (most recent call last):
File "/usr/lib/python3.5/configparser.py", line 1135, in _unify_values
sectiondict = self._sections[section]
KeyError: 'token'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/lvensel/projects/worklion01/worklion01/wl_cron.py", line 15, in <module>
wl_post_projects.post()
File "/home/lvensel/projects/worklion01/worklion01/wl_post_projects.py", line 15, in post
import wl_get_background_jobs
File "/home/lvensel/projects/worklion01/worklion01/wl_get_background_jobs.py", line 12, in <module>
oauth, token = wl_secure_token.fetch_token()
File "/home/lvensel/projects/worklion01/worklion01/wl_secure_token.py", line 17, in fetch_token
values = wl_get_ini.get_values()
File "/home/lvensel/projects/worklion01/worklion01/wl_get_ini.py", line 13, in get_values
'token_url': config.get('token', 'token_url'),
File "/usr/lib/python3.5/configparser.py", line 778, in get
d = self._unify_values(section, vars)
File "/usr/lib/python3.5/configparser.py", line 1138, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: 'token'
Let me guess on what potentially happens:
Cron jobs are run by root
virtualenv is run by your user with a custom python environment.
root does not know about your virtualenv, then cannot match your user's python environment, thus your script fails. Probably with some cannot import or alike errors.
Have a look at replies here.

python error while executing post-commit script from console

#sh post-commit
I am getting bellow error, How to fix this.
sh post-commit
Traceback (most recent call last):
File "/SVNData/testrepo/hooks/mailer.py", line 1353, in <module>
sys.argv[3:3+expected_args])
File "/usr/lib/python2.7/dist-packages/svn/core.py", line 281, in run_app
return func(application_pool, *args, **kw)
File "/SVNData/testrepo/hooks/mailer.py", line 81, in main
revision = int(cmd_args[0])
ValueError: invalid literal for int() with base 10: ''
Thanks.
Try this:
revision = int(''.join(cmd_args[0].split()))

Categories

Resources