#4895 Error when adding/removing SSH key from profile
Closed: Invalid 3 years ago by sergiodj. Opened 3 years ago by sergiodj.

I created a profile, added a SSH key, and then tried to remove it. I got the same error when adding and removing the key:

Jun 07 15:32:43 debian-pagure-new celery[6739]: 2020-06-07 15:32:43,719 [ERROR] celery.app.trace: Task pagure.lib.tasks.remove_key_from_authorized_keys[b07c73e1-0d75-43f6-99b2-4adb66ceb00f] raised unexpected: TypeError('stat: path should be string, bytes, os.PathLike or integer, not NoneType')
Jun 07 15:32:43 debian-pagure-new celery[6739]: Traceback (most recent call last):
Jun 07 15:32:43 debian-pagure-new celery[6739]:   File "/usr/lib/python3/dist-packages/celery/app/trace.py", line 382, in trace_task
Jun 07 15:32:43 debian-pagure-new celery[6739]:     R = retval = fun(*args, **kwargs)
Jun 07 15:32:43 debian-pagure-new celery[6739]:   File "/usr/lib/python3/dist-packages/celery/app/trace.py", line 641, in __protected_call__
Jun 07 15:32:43 debian-pagure-new celery[6739]:     return self.run(*args, **kwargs)
Jun 07 15:32:43 debian-pagure-new celery[6739]:   File "/usr/lib/python3/dist-packages/pagure/lib/tasks_utils.py", line 36, in decorated_function
Jun 07 15:32:43 debian-pagure-new celery[6739]:     return function(self, session, *args, **kwargs)
Jun 07 15:32:43 debian-pagure-new celery[6739]:   File "/usr/lib/python3/dist-packages/pagure/lib/tasks.py", line 1281, in remove_key_from_authorized_keys
Jun 07 15:32:43 debian-pagure-new celery[6739]:     if not os.path.exists(ssh_folder):
Jun 07 15:32:43 debian-pagure-new celery[6739]:   File "/usr/lib/python3.7/genericpath.py", line 19, in exists
Jun 07 15:32:43 debian-pagure-new celery[6739]:     os.stat(path)
Jun 07 15:32:43 debian-pagure-new celery[6739]: TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Apparently the key was successfully added and removed, so I don't know how important this error is, but I thought it'd be good to report it anyway.


Metadata Update from @sergiodj:
- Issue close_status updated to: Invalid
- Issue status updated to: Closed (was: Open)

3 years ago

Sorry, I had forgotten to define SSH_FOLDER.

Login to comment on this ticket.

Metadata