Issue #605
closeddocker uploading of a wrong type file returns exception
Description
Description of problem:
Feeding docker upload with a wrong file type returns exception.
It happens with both -d and -f options.
Version-Release number of selected component (if applicable):
pulp-server-2.5.0-0.14.beta.fc20.noarch
docker-io-1.3.0-1.fc20.x86_64
pulp-docker-plugins-0.2.1-0.2.beta.fc20.noarch
python-pulp-docker-common-0.2.1-0.2.beta.fc20.noarch
pulp-docker-admin-extensions-0.2.1-0.2.beta.fc20.noarch
How reproducible:
always
pulp-admin -u admin -p admin docker repo uploads upload --repo-id extra_files --file /home/duck-0.6-1.noarch.rpm
--------------------------------------------------------------------
Unit Upload
--------------------------------------------------------------------
Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: duck-0.6-1.noarch.rpm
... completed
Creating upload requests on the server...
[==================================================] 100%
Initializing: duck-0.6-1.noarch.rpm
... completed
Starting upload of selected units. If this process is stopped through ctrl+c,
the uploads will be paused and may be resumed later using the resume command or
cancelled entirely using the cancel command.
Uploading: duck-0.6-1.noarch.rpm
[==================================================] 100%
2463/2463 bytes
... completed
Importing into the repository...
This command may be exited via ctrl+c without affecting the request.
[\]
Running...
Task Failed
Pulp exception occurred: PulpExecutionException
Deleting the upload request...
... completed
less ~/.pulp/server_calls.log
2014-11-03 18:13:04,986 - INFO - Response body :
{
"exception": null,
"task_type": "pulp.server.managers.content.upload.import_uploaded_unit",
"_href": "/pulp/api/v2/tasks/871e7357-9046-4326-8391-60550605d3ce/",
"task_id": "871e7357-9046-4326-8391-60550605d3ce",
"tags": [
"pulp:repository:extra_files",
"pulp:action:import_upload"
],
"finish_time": "2014-11-03T18:13:03Z",
"_ns": "task_status",
"start_time": "2014-11-03T18:13:03Z",
"traceback": "Traceback (most recent call last):\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 315, in call\n return super(Task, self).__call__(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 437, in protected_call\n return self.run(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/managers/content/upload.py\", line 225, in import_uploaded_unit\n unit_metadata, file_path, conduit, call_config)\n File \"/usr/lib/python2.7/site-packages/pulp_docker/plugins/importers/importer.py\", line 133, in upload_unit\n metadata = tarutils.get_metadata(file_path)\n File \"/usr/lib/python2.7/site-packages/pulp_docker/common/tarutils.py\", line 27, in get_metadata\n with contextlib.closing(tarfile.open(tarfile_path)) as archive:\n File \"/usr/lib64/python2.7/tarfile.py\", line 1665, in open\n raise ReadError(\"file could not be opened successfully\")\nPulpExecutionException: Pulp exception occurred: PulpExecutionException\n",
"spawned_tasks": [],
"progress_report": {},
"queue": "reserved_resource_worker-0@ip-10-81-164-68.eu-west-1.compute.internal.dq",
"state": "error",
"result": null,
"error": {
"code": "PLP0000",
"data": {},
"description": "Pulp exception occurred: PulpExecutionException",
"sub_errors": []
},
"_id": {
"$oid": "5457c5afe1aaedef5c07c1db"
},
"id": "5457c5af99cca856d3d1ae78"
}
2014-11-03 18:13:05,144 - INFO - DELETE request to /pulp/api/v2/content/uploads/91153693-1ce0-4d1e-8031-fa640417889d/ with parameters None
2014-11-03 18:13:05,144 - INFO - Response status : 200
2014-11-03 18:13:05,144 - INFO - Response body :
null
Expected results:
A message smth like when rpm upload is feeded with a wrong type:
pulp-admin rpm repo uploads rpm --repo-id gena --file /home/_new.txt
--------------------------------------------------------------------
Unit Upload
--------------------------------------------------------------------
Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: _new
... completed
Creating upload requests on the server...
[==================================================] 100%
Initializing: _new
... completed
Starting upload of selected units. If this process is stopped through ctrl+c,
the uploads will be paused and may be resumed later using the resume command or
cancelled entirely using the cancel command.
Uploading: _new
[==================================================] 100%
244/244 bytes
... completed
Importing into the repository...
This command may be exited via ctrl+c without affecting the request.
[\]
Running...
Task Failed
metadata for the given package could not be extracted
+ This bug was cloned from Bugzilla Bug #1159966 +
Updated by igulina@redhat.com about 9 years ago
An example of how rpm upload reacts on not rpm files when we specify a folder to upload from:
ll
total 24
drwx------. 6 buildbot buildbot 4096 Nov 3 18:00 buildbot
rw-r--r-. 1 root root 3139 Aug 19 11:25 copy_of_pulp_admin
rw-r--r-. 1 root root 2463 Nov 3 18:03 duck-0.6-1.noarch.rpm
-rwxr-xr-x. 1 root root 60 Aug 22 09:47 _if_test
-rwxr-xr-x. 1 root root 427 Aug 20 19:48 _my
-rwxr-xr-x. 1 root root 244 Oct 3 12:44 _new
pulp-admin rpm repo uploads rpm --repo-id gena --dir /home
--------------------------------------------------------------------
Unit Upload
--------------------------------------------------------------------
Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: duck-0.6-1.noarch.rpm
... completed
Creating upload requests on the server...
[==================================================] 100%
Initializing: duck-0.6-1.noarch.rpm
... completed
Starting upload of selected units. If this process is stopped through ctrl+c,
the uploads will be paused and may be resumed later using the resume command or
cancelled entirely using the cancel command.
Uploading: duck-0.6-1.noarch.rpm
[==================================================] 100%
2463/2463 bytes
... completed
Importing into the repository...
This command may be exited via ctrl+c without affecting the request.
[\]
Running...
Task Succeeded
Deleting the upload request...
... completed
+ This comment was cloned from Bugzilla #1159966 comment 1 +
Updated by bmbouter almost 9 years ago
- Version deleted (
2.5) - Version - Docker set to master
Updated by ipanova@redhat.com almost 6 years ago
- Status changed from NEW to CLOSED - CURRENTRELEASE