Project

Profile

Help

Issue #5709

closed

Provide a descriptive error for invalid treeinfo files

Added by fao89 over 2 years ago. Updated over 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 62
Quarter:

Description

In [1]: import requests                                                                                                                                                                                                                       

In [2]: requests.get("http://myrepo.com/.treeinfo")                                                                                                                                                                                           
Out[2]: <Response [200]>

In [3]: rep = requests.get("http://myrepo.com/.treeinfo")                                                                                                                                                                                     

In [4]: rep.content                                                                                                                                                                                                                           
Out[4]: b'<!doctype html><html lang="en"><head><meta http-equiv="content-type" content="text/html;charset=utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"><title></title><script src="https://www.google.com/adsense/domains/caf.js" type="text/javascript"></script><noscript><style>#content-main{display:none}</style><div>For full functionality of this site it is necessary to enable JavaScript. Here are the <a target="_blank" href="https://www.enable-javascript.com/">instructions how to enable JavaScript in your web browser</a>.</div></noscript></head><body><div id="contentMain"></div><script type="text/javascript" src="https://d1hi41nc56pmug.cloudfront.net/static/js/main.7b96a6d1.js"></script></body></html>'
pulp_smash.exceptions.TaskReportError: ('Task report /pulp/api/v3/tasks/9a029672-caf7-4ec1-aa83-494cb4c26403/ contains a error: {\'traceback\': \'  File "/usr/local/lib/pulp/lib64/python3.7$
site-packages/rq/worker.py", line 822, in perform_job\\n    rv = job.perform()\\n  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 605, in perform\\n    self._resul$ = self._execute()\\n  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 611, in _execute\\n    return self.func(*self.args, **self.kwargs)\\n  File "/home/vagrant/de$el/pulp_rpm/pulp_rpm/app/tasks/synchronizing.py", line 113, in synchronize\\n    kickstart = get_kickstart_data(remote)\\n  File "/home/vagrant/devel/pulp_rpm/pulp_rpm/app/tasks/utils.py", $ine 28, in get_kickstart_data\\n    parser.read_file(treeinfo)\\n  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/productmd/common.py", line 569, in read_file\\n    return super(So$tedConfigParser, self).read_file(*args, **kwargs)\\n  File "/usr/lib64/python3.7/configparser.py", line 717, in read_file\\n    self._read(f, source)\\n  File "/usr/lib64/python3.7/configpa$ser.py", line 1079, in _read\\n    raise MissingSectionHeaderError(fpname, lineno, line)\\n\', \'description\': \'File contains no section headers.\\nfile: \\\'/run/pulpcore-worker-1/tmplpo$zlp5\\\', line: 1\\n\\\'<!doctype html><html lang="en"><head><meta http-equiv="content-type" content="text/html;charset=utf-8"><meta name="viewport" content="width=device-width,initial-scal$=1"><link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"><title></title><script src="https://www.google.com/adsense/domains/caf.js" type="text/javascript"></script><nosc$ipt><style>#content-main{display:none}</style><div>For full functionality of this site it is necessary to enable JavaScript. Here are the <a target="_blank" href="https://www.enable-javascr$pt.com/">instructions how to enable JavaScript in your web browser</a>.</div></noscript></head><body><div id="contentMain"></div><script type="text/javascript" src="https://d1hi41nc56pmug.c$oudfront.net/static/js/main.7b96a6d1.js"></script></body></html>\\\'\'}\nFull task report: {\'pulp_href\': \'/pulp/api/v3/tasks/9a029672-caf7-4ec1-aa83-494cb4c26403/\', \'pulp_created\': \'$019-11-13T18:01:18.701800Z\', \'state\': \'failed\', \'name\': \'pulp_rpm.app.tasks.synchronizing.synchronize\', \'started_at\': \'2019-11-13T18:01:18.757265Z\', \'finished_at\': \'2019-11-$3T18:01:19.203364Z\', \'error\': {\'traceback\': \'  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py", line 822, in perform_job\\n    rv = job.perform()\\n  File "/usr/$ocal/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 605, in perform\\n    self._result = self._execute()\\n  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", lin$ 611, in _execute\\n    return self.func(*self.args, **self.kwargs)\\n  File "/home/vagrant/devel/pulp_rpm/pulp_rpm/app/tasks/synchronizing.py", line 113, in synchronize\\n    kickstart = g$t_kickstart_data(remote)\\n  File "/home/vagrant/devel/pulp_rpm/pulp_rpm/app/tasks/utils.py", line 28, in get_kickstart_data\\n    parser.read_file(treeinfo)\\n  File "/usr/local/lib/pulp/l$b64/python3.7/site-packages/productmd/common.py", line 569, in read_file\\n    return super(SortedConfigParser, self).read_file(*args, **kwargs)\\n  File "/usr/lib64/python3.7/configparser.$y", line 717, in read_file\\n    self._read(f, source)\\n  File "/usr/lib64/python3.7/configparser.py", line 1079, in _read\\n    raise MissingSectionHeaderError(fpname, lineno, line)\\n\', \'description\': \'File contains no section headers.\\nfile: \\\'/run/pulpcore-worker-1/tmplpo6zlp5\\\', line: 1\\n\\\'<!doctype html><html lang="en"><head><meta http-equiv="content-type" c$ntent="text/html;charset=utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"><title></title><s$ript src="https://www.google.com/adsense/domains/caf.js" type="text/javascript"></script><noscript><style>#content-main{display:none}</style><div>For full functionality of this site it is n$cessary to enable JavaScript. Here are the <a target="_blank" href="https://www.enable-javascript.com/">instructions how to enable JavaScript in your web browser</a>.</div></noscript></head$<body><div id="contentMain"></div><script type="text/javascript" src="https://d1hi41nc56pmug.cloudfront.net/static/js/main.7b96a6d1.js"></script></body></html>\\\'\'}, \'worker\': \'/pulp/api/v3/workers/dac91c90-461e-4f93-88e0-4c1a2941b4bb/\', \'parent\': None, \'spawned_tasks\': [], \'progress_reports\': [], \'created_resources\': [], \'reserved_resources_record\': [\'/pulp/ap
i/v3/repositories/rpm/rpm/a837faf8-7152-47bc-9855-e968905428b1/\', \'/pulp/api/v3/remotes/rpm/rpm/c96f4cf2-1ade-49ef-8b11-b42ba08206ee/\']}', {'pulp_href': '/pulp/api/v3/tasks/9a029672-caf7-
4ec1-aa83-494cb4c26403/', 'pulp_created': '2019-11-13T18:01:18.701800Z', 'state': 'failed', 'name': 'pulp_rpm.app.tasks.synchronizing.synchronize', 'started_at': '2019-11-13T18:01:18.757265Z
', 'finished_at': '2019-11-13T18:01:19.203364Z', 'error': {'traceback': '  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py", line 822, in perform_job\n    rv = job.perfo
rm()\n  File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 605, in perform\n    self._result = self._execute()\n  File "/usr/local/lib/pulp/lib64/python3.7/site-package
s/rq/job.py", line 611, in _execute\n    return self.func(*self.args, **self.kwargs)\n  File "/home/vagrant/devel/pulp_rpm/pulp_rpm/app/tasks/synchronizing.py", line 113, in synchronize\n   
 kickstart = get_kickstart_data(remote)\n  File "/home/vagrant/devel/pulp_rpm/pulp_rpm/app/tasks/utils.py", line 28, in get_kickstart_data\n    parser.read_file(treeinfo)\n  File "/usr/local
/lib/pulp/lib64/python3.7/site-packages/productmd/common.py", line 569, in read_file\n    return super(SortedConfigParser, self).read_file(*args, **kwargs)\n  File "/usr/lib64/python3.7/conf
igparser.py", line 717, in read_file\n    self._read(f, source)\n  File "/usr/lib64/python3.7/configparser.py", line 1079, in _read\n    raise MissingSectionHeaderError(fpname, lineno, line)
\n', 'description': 'File contains no section headers.\nfile: \'/run/pulpcore-worker-1/tmplpo6zlp5\', line: 1\n\'<!doctype html><html lang="en"><head><meta http-equiv="content-type" content=
"text/html;charset=utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"><title></title><script s
rc="https://www.google.com/adsense/domains/caf.js" type="text/javascript"></script><noscript><style>#content-main{display:none}</style><div>For full functionality of this site it is necessar
y to enable JavaScript. Here are the <a target="_blank" href="https://www.enable-javascript.com/">instructions how to enable JavaScript in your web browser</a>.</div></noscript></head><body>
<div id="contentMain"></div><script type="text/javascript" src="https://d1hi41nc56pmug.cloudfront.net/static/js/main.7b96a6d1.js"></script></body></html>\''}, 'worker': '/pulp/api/v3/workers
/dac91c90-461e-4f93-88e0-4c1a2941b4bb/', 'parent': None, 'spawned_tasks': [], 'progress_reports': [], 'created_resources': [], 'reserved_resources_record': ['/pulp/api/v3/repositories/rpm/rp
m/a837faf8-7152-47bc-9855-e968905428b1/', '/pulp/api/v3/remotes/rpm/rpm/c96f4cf2-1ade-49ef-8b11-b42ba08206ee/']})
Actions #1

Updated by fao89 over 2 years ago

  • Status changed from NEW to POST
Actions #2

Updated by fao89 over 2 years ago

  • Assignee set to fao89
Actions #3

Updated by ttereshc over 2 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 62

Added by Fabricio Aguiar over 2 years ago

Revision c64a1ce8

Descriptive error for invalid treeinfo files

https://pulp.plan.io/issues/5709 closes #5709

Actions #4

Updated by Anonymous over 2 years ago

  • Status changed from POST to MODIFIED

Added by Fabricio Aguiar over 2 years ago

Revision 6787c71c

Descriptive error for invalid treeinfo files

https://pulp.plan.io/issues/5709 closes #5709

(cherry picked from commit c64a1ce8514eda80c5a30632de977cc37deb1409)

Actions #5

Updated by Anonymous over 2 years ago

Actions #6

Updated by ttereshc over 2 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF