Issue #2240
closedCan't export rpm repo
Description
When we try to export an rpm repo as iso, we get the following error:
# pulp-admin rpm repo export run --repo-id=company_puppet_el6
+----------------------------------------------------------------------+
Publishing Repository [company_puppet_el6]
+----------------------------------------------------------------------+
This command may be exited via ctrl+c without affecting the request.
Task Failed
can't compare datetime.datetime to NoneType
Those are the logs from journalctl:
sep 08 03:55:55 v-so-repo-01.company.net pulp[949]: pulp.server.async.tasks:INFO: Task failed : [fe4745a6-a772-47dd-9de9-b4611e7135e3]
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) Task pulp.server.managers.repo.publish.publish[fe4745a6-a772-47dd-9de9-b4611e7135e3] raised unexpected: TypeError("can't compare datetime.datetime to NoneType",)
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) Traceback (most recent call last):
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) R = retval = fun(*args, **kwargs)
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 484, in __call__
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) return super(Task, self).__call__(*args, **kwargs)
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 103, in __call__
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) return super(PulpTask, self).__call__(*args, **kwargs)
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) return self.run(*args, **kwargs)
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 971, in publish
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) result = check_publish(repo_obj, dist_id, dist_inst, transfer_repo, conduit, call_config)
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 1008, in check_publish
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) dist_updated = dist.last_updated > last_published
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:ERROR: (803-99296) TypeError: can't compare datetime.datetime to NoneType
sep 08 03:55:55 v-so-repo-01.company.net pulp[803]: celery.worker.job:INFO: Task pulp.server.async.tasks._release_resource[ec4ba480-0f0a-4c0d-8932-75070be6ce67] succeeded in 0.00981830619276s: None
Updated by cristi.falcas@gmail.com over 7 years ago
It seems that the error is thrown only for repos without a feed.
We have some local repos managed internally, which don't have a feed url. For all of those, the export fails.
Updated by bmbouter over 7 years ago
I had known about the inability to sync if a feed is not specified, but I did not know about the inability to export. The former I can understand but the latter (this bug) seems like a problem.
Updated by amacdona@redhat.com over 7 years ago
- Priority changed from Normal to High
- Severity changed from 2. Medium to 3. High
- Triaged changed from No to Yes
Updated by ipanova@redhat.com over 7 years ago
I tested on 2.9.3 and was not able to reproduce.
1 created an rpm repo
2 uploaded some content
3 triggered export
4 export succeeded
Looking at the code and your traceback, is seems like dist.last_updated is none, which cannot be true unless you did not forget to run migrations. Because there was a separate migration written to populate last_updated field. Can you confirm that after running the migrations you still have the issue?
Updated by mihai.ibanescu@gmail.com over 7 years ago
I am occasionally seeing the same exact traceback (one line off) on pulp 2.10.3.
Under certain circumstances, which I cannot explain, distributors end up having last_publish set, but last_updated unset:
Last Publish: 2017-01-04T11:34:41Z
Last Updated: None
Subsequent publishes fail with:
Task Failed
can't compare datetime.datetime to NoneType
Full traceback:
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) Task pulp.server.managers.repo.publish.publish[fbcf3910-2ddb-4699-b432-6709c35b9936] raised unexpected: TypeError("can't compare datetime.datetime to NoneType",)
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) Traceback (most recent call last):
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) R = retval = fun(*args, **kwargs)
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 488, in __call__
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) return super(Task, self).__call__(*args, **kwargs)
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 103, in __call__
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) return super(PulpTask, self).__call__(*args, **kwargs)
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) return self.run(*args, **kwargs)
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 971, in publish
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) result = check_publish(repo_obj, dist_id, dist_inst, transfer_repo, conduit, call_config)
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 1007, in check_publish
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) dist_updated = dist.last_updated > last_published
Jan 04 17:33:38 repulpmaster03 pulp[18362]: celery.worker.job:ERROR: (18362-82912) TypeError: can't compare datetime.datetime to NoneType
Added by ttereshc about 7 years ago
Added by ttereshc about 7 years ago
Revision 2a012b1d | View on GitHub
Set last_updated for distributor if it is absent or None
Updated by ttereshc about 7 years ago
- Status changed from NEW to POST
- Assignee set to ttereshc
- Sprint/Milestone set to 36
Updated by ttereshc about 7 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|2a012b1d51afb384786a840b489db35ee14e0e6c.
Updated by bizhang about 7 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
Set last_updated for distributor if it is absent or None
closes #2240 https://pulp.plan.io/issues/2240