django-DefectDojo icon indicating copy to clipboard operation
django-DefectDojo copied to clipboard

Removing corrupted schedule file '/run/celery-beat-schedule': error(13, 'Permission denied')

Open MagicScorpion opened this issue 6 years ago • 7 comments

Bug description A clear and concise description of what the bug is.

Steps to reproduce Steps to reproduce the behavior:

  1. Follow "https://defectdojo.readthedocs.io/en/latest/upgrading.html" steps
  2. Run From inside the django-DefectDojo/ directory execute:

#celery -A dojo worker -l info --concurrency 3

#celery beat -A dojo -l info

use "https://defectdojo.readthedocs.io/en/latest/running-in-production.html"

Expected behavior Celery beat should start with no error.

Deployment method (select with an X)

  • [ ] Kubernetes
  • [ ] Docker
  • [X] setup.bash / legacy-setup.bash

Environment information

  • Operating System: Red Hat Linux
  • DefectDojo Commit Message: [use git show -s --format="%h: %s [%ci]"] 9986e86

E

MagicScorpion avatar Mar 11 '20 21:03 MagicScorpion

bash: [2020-03-11 20:36:05,588: INFO/MainProcess] beat: Starting... bash: [2020-03-11 20:36:05,593: ERROR/MainProcess] Removing corrupted schedule file '/run/celery-beat-schedule': error(13, 'Permission denied') bash: Traceback (most recent call last): bash: File "/usr/local/lib/python3.6/site-packages/kombu/utils/objects.py", line 42, in get bash: return obj.dict[self.name] bash: KeyError: 'scheduler' bash: During handling of the above exception, another exception occurred: bash: Traceback (most recent call last): bash: File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 519, in setup_schedule bash: self._store = self._open_schedule() bash: File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 509, in _open_schedule bash: return self.persistence.open(self.schedule_filename, writeback=True) bash: File "/usr/lib64/python3.6/shelve.py", line 243, in open bash: return DbfilenameShelf(filename, flag, protocol, writeback) bash: File "/usr/lib64/python3.6/shelve.py", line 227, in init bash: Shelf.init(self, dbm.open(filename, flag), protocol, writeback) bash: File "/usr/lib64/python3.6/dbm/init.py", line 94, in open bash: return mod.open(file, flag, mode) bash: _gdbm.error: [Errno 13] Permission denied bash: [2020-03-11 20:36:05,597: CRITICAL/MainProcess] beat raised exception <class '_gdbm.error'>: error(13, 'Permission denied') [2020-03-11 20:36:05,599: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/kombu/utils/objects.py", line 42, in get bash: [2020-03-11 20:36:05,599: WARNING/MainProcess] return obj.dict[self.name] bash: [2020-03-11 20:36:05,599: WARNING/MainProcess] KeyError bash: [2020-03-11 20:36:05,599: WARNING/MainProcess] : bash: [2020-03-11 20:36:05,600: WARNING/MainProcess] 'scheduler' bash: [2020-03-11 20:36:05,600: WARNING/MainProcess] During handling of the above exception, another exception occurred: bash: [2020-03-11 20:36:05,600: WARNING/MainProcess] Traceback (most recent call last): bash: [2020-03-11 20:36:05,600: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 519, in setup_schedule bash: [2020-03-11 20:36:05,601: WARNING/MainProcess] self._store = self._open_schedule() bash: [2020-03-11 20:36:05,601: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 509, in _open_schedule bash: [2020-03-11 20:36:05,601: WARNING/MainProcess] return self.persistence.open(self.schedule_filename, writeback=True) bash: [2020-03-11 20:36:05,602: WARNING/MainProcess] File "/usr/lib64/python3.6/shelve.py", line 243, in open bash: [2020-03-11 20:36:05,602: WARNING/MainProcess] return DbfilenameShelf(filename, flag, protocol, writeback) bash: [2020-03-11 20:36:05,602: WARNING/MainProcess] File "/usr/lib64/python3.6/shelve.py", line 227, in init bash: [2020-03-11 20:36:05,603: WARNING/MainProcess] Shelf.init(self, dbm.open(filename, flag), protocol, writeback) bash: [2020-03-11 20:36:05,603: WARNING/MainProcess] File "/usr/lib64/python3.6/dbm/init.py", line 94, in open bash: [2020-03-11 20:36:05,603: WARNING/MainProcess] return mod.open(file, flag, mode) bash: [2020-03-11 20:36:05,604: WARNING/MainProcess] _gdbm bash: [2020-03-11 20:36:05,604: WARNING/MainProcess] . bash: [2020-03-11 20:36:05,604: WARNING/MainProcess] error bash: [2020-03-11 20:36:05,604: WARNING/MainProcess] : bash: [2020-03-11 20:36:05,604: WARNING/MainProcess] [Errno 13] Permission denied bash: [2020-03-11 20:36:05,604: WARNING/MainProcess] During handling of the above exception, another exception occurred: bash: [2020-03-11 20:36:05,604: WARNING/MainProcess] Traceback (most recent call last): bash: [2020-03-11 20:36:05,604: WARNING/MainProcess] File "/usr/local/bin/celery", line 8, in bash: [2020-03-11 20:36:05,605: WARNING/MainProcess] sys.exit(main()) bash: [2020-03-11 20:36:05,605: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/main.py", line 16, in main bash: [2020-03-11 20:36:05,605: WARNING/MainProcess] _main() bash: [2020-03-11 20:36:05,606: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/bin/celery.py", line 322, in main bash: [2020-03-11 20:36:05,606: WARNING/MainProcess] cmd.execute_from_commandline(argv) bash: [2020-03-11 20:36:05,606: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/bin/celery.py", line 495, in execute_from_commandline bash: [2020-03-11 20:36:05,607: WARNING/MainProcess] super(CeleryCommand, self).execute_from_commandline(argv))) bash: [2020-03-11 20:36:05,607: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/bin/base.py", line 305, in execute_from_commandline bash: [2020-03-11 20:36:05,608: WARNING/MainProcess] return self.handle_argv(self.prog_name, argv[1:]) bash: [2020-03-11 20:36:05,608: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/bin/celery.py", line 487, in handle_argv bash: [2020-03-11 20:36:05,609: WARNING/MainProcess] return self.execute(command, argv) bash: [2020-03-11 20:36:05,609: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/bin/celery.py", line 419, in execute bash: [2020-03-11 20:36:05,609: WARNING/MainProcess] ).run_from_argv(self.prog_name, argv[1:], command=argv[0]) bash: [2020-03-11 20:36:05,610: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/bin/base.py", line 309, in run_from_argv bash: [2020-03-11 20:36:05,610: WARNING/MainProcess] sys.argv if argv is None else argv, command) bash: [2020-03-11 20:36:05,610: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/bin/base.py", line 393, in handle_argv bash: [2020-03-11 20:36:05,611: WARNING/MainProcess] return self(*args, **options) bash: [2020-03-11 20:36:05,611: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/bin/base.py", line 253, in call bash: [2020-03-11 20:36:05,612: WARNING/MainProcess] ret = self.run(*args, **kwargs) bash: [2020-03-11 20:36:05,612: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/bin/beat.py", line 109, in run bash: [2020-03-11 20:36:05,612: WARNING/MainProcess] return beat().run() bash: [2020-03-11 20:36:05,612: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/apps/beat.py", line 81, in run bash: [2020-03-11 20:36:05,613: WARNING/MainProcess] self.start_scheduler() bash: [2020-03-11 20:36:05,613: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/apps/beat.py", line 109, in start_scheduler bash: [2020-03-11 20:36:05,613: WARNING/MainProcess] service.start() bash: [2020-03-11 20:36:05,614: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 622, in start bash: [2020-03-11 20:36:05,614: WARNING/MainProcess] humanize_seconds(self.scheduler.max_interval)) bash: [2020-03-11 20:36:05,615: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/kombu/utils/objects.py", line 44, in get bash: [2020-03-11 20:36:05,615: WARNING/MainProcess] value = obj.dict[self.name] = self.__get(obj) bash: [2020-03-11 20:36:05,615: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 666, in scheduler bash: [2020-03-11 20:36:05,616: WARNING/MainProcess] return self.get_scheduler() bash: [2020-03-11 20:36:05,616: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 661, in get_scheduler bash: [2020-03-11 20:36:05,617: WARNING/MainProcess] lazy=lazy, bash: [2020-03-11 20:36:05,617: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 501, in init bash: [2020-03-11 20:36:05,618: WARNING/MainProcess] Scheduler.init(self, *args, kwargs) bash: [2020-03-11 20:36:05,618: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 257, in init bash: [2020-03-11 20:36:05,618: WARNING/MainProcess] self.setup_schedule() bash: [2020-03-11 20:36:05,618: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 527, in setup_schedule bash: [2020-03-11 20:36:05,619: WARNING/MainProcess] self._store = self._destroy_open_corrupted_schedule(exc) bash: [2020-03-11 20:36:05,619: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 515, in _destroy_open_corrupted_schedule bash: [2020-03-11 20:36:05,620: WARNING/MainProcess] return self._open_schedule() bash: [2020-03-11 20:36:05,620: WARNING/MainProcess] File "/usr/local/lib/python3.6/site-packages/celery/beat.py", line 509, in _open_schedule bash: [2020-03-11 20:36:05,621: WARNING/MainProcess] return self.persistence.open(self.schedule_filename, writeback=True) bash: [2020-03-11 20:36:05,621: WARNING/MainProcess] File "/usr/lib64/python3.6/shelve.py", line 243, in open bash: [2020-03-11 20:36:05,621: WARNING/MainProcess] return DbfilenameShelf(filename, flag, protocol, writeback) bash: [2020-03-11 20:36:05,622: WARNING/MainProcess] File "/usr/lib64/python3.6/shelve.py", line 227, in init bash: [2020-03-11 20:36:05,622: WARNING/MainProcess] Shelf.init(self, dbm.open(filename, flag), protocol, writeback) bash: [2020-03-11 20:36:05,622: WARNING/MainProcess] File "/usr/lib64/python3.6/dbm/init.py", line 94, in open bash: [2020-03-11 20:36:05,623: WARNING/MainProcess] return mod.open(file, flag, mode) bash: [2020-03-11 20:36:05,623: WARNING/MainProcess] _gdbm bash: [2020-03-11 20:36:05,623: WARNING/MainProcess] . bash: [2020-03-11 20:36:05,623: WARNING/MainProcess] error bash: [2020-03-11 20:36:05,623: WARNING/MainProcess] : bash: [2020-03-11 20:36:05,624: WARNING/MainProcess] [Errno 13] Permission denied bash: celery beat v4.4.1 (cliffs) is starting. bash: __ - ... __ - _ bash: LocalTime -> 2020-03-11 20:36:05 bash: Configuration -> bash: . broker -> amqp://defectdojo:@localhost:5672// bash: . loader -> celery.loaders.app.AppLoader bash: . scheduler -> celery.beat.PersistentScheduler bash: . db -> /run/celery-beat-schedule bash: . logfile -> [stderr]@%INFO bash: . maxinterval -> 5.00 minutes (300s) systemd: celery-beat.service: main process exited, code=exited, status=1/FAILURE systemd: Unit celery-beat.service entered failed state. systemd: celery-beat.service failed. python3: [11/Mar/2020 20:24:17] "POST /webhook/?user_id=cervenb&user_key=cervenb HTTP/1.1" 404 1783 systemd: celery-beat.service holdoff time over, scheduling restart.

MagicScorpion avatar Mar 11 '20 21:03 MagicScorpion

@ptrovatelli Can you please comment on this?

MagicScorpion avatar Apr 01 '20 17:04 MagicScorpion

sorry never used the setup bash; i'm only using docker and kubernetes and I didn't see that issue. I think @devGregA is our setupbash expert; does this issue ring a bell Greg?

ptrovatelli avatar Apr 01 '20 20:04 ptrovatelli

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 03 '20 03:07 stale[bot]

[email protected] you got the solution?

rahulsdev avatar Dec 02 '20 10:12 rahulsdev

@MagicScorpion and @rahulsdev I am having the same issue while spinning glitchtip up using helm on kubernetes ``` 2021-08-04 10:24:01,790: WARNING/MainProcess] File "/usr/local/lib/python3.9/dbm/init.py", line 95, in open

[2021-08-04 10:24:01,790: WARNING/MainProcess] [2021-08-04 10:24:01,790: WARNING/MainProcess] return mod.open(file, flag, mode) [2021-08-04 10:24:01,790: WARNING/MainProcess]

[2021-08-04 10:24:01,790: WARNING/MainProcess] _gdbm [2021-08-04 10:24:01,790: WARNING/MainProcess] . [2021-08-04 10:24:01,790: WARNING/MainProcess] error [2021-08-04 10:24:01,790: WARNING/MainProcess] : [2021-08-04 10:24:01,790: WARNING/MainProcess] [Errno 13] Permission denied: 'celerybeat-schedule' [2021-08-04 10:24:01,790: WARNING/MainProcess]

Nanyte25 avatar Aug 04 '21 10:08 Nanyte25

Please did any one resolve this issue?

Forchapeatl avatar Mar 12 '22 20:03 Forchapeatl