https://prefect.io logo
c

Charles Leung

09/14/2023, 8:56 PM
Hi @Prefect, I get this weird error on the agent console whenever I kick things off. It looks like it's trying to write things to prefect.log at the same time. This error occurs when I use the .submit() task and multiple tasks are kicking off in the same flow. How do we get around this so everything is populated correctly?
Copy code
--- Logging error ---
Traceback (most recent call last):
  File "\\v-tm-qeq-05\Prefect_Env\lib\logging\handlers.py", line 70, in emit
    self.doRollover()
  File "\\v-tm-qeq-05\Prefect_Env\lib\logging\handlers.py", line 171, in doRollover
    self.rotate(self.baseFilename, dfn)
  File "\\v-tm-qeq-05\Prefect_Env\lib\logging\handlers.py", line 111, in rotate
    os.rename(source, dest)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\qtask\\prefect.log' -> 'C:\\Users\\qtask\\prefect.log.1'
Call stack:
  File "\\v-tm-qeq-05\Prefect_Env\lib\threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
  File "\\v-tm-qeq-05\Prefect_Env\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "\\v-tm-qeq-05\Prefect_Env\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "\\v-tm-qeq-05\Prefect_Env\lib\site-packages\prefect\_internal\concurrency\threads.py", line 90, in _entrypoint
    self._run_until_shutdown()
  File "\\v-tm-qeq-05\Prefect_Env\lib\site-packages\prefect\_internal\concurrency\threads.py", line 105, in _run_until_shutdown
    task = call.run()
  File "\\v-tm-qeq-05\Prefect_Env\lib\site-packages\prefect\_internal\concurrency\calls.py", line 272, in run
    return self.context.run(asyncio.run, self._run_async(coro))
  File "\\v-tm-qeq-05\Prefect_Env\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "\\v-tm-qeq-05\Prefect_Env\lib\asyncio\base_events.py", line 603, in run_until_complete
    self.run_forever()
  File "\\v-tm-qeq-05\Prefect_Env\lib\asyncio\windows_events.py", line 316, in run_forever
    super().run_forever()
  File "\\v-tm-qeq-05\Prefect_Env\lib\asyncio\base_events.py", line 570, in run_forever
    self._run_once()
  File "\\v-tm-qeq-05\Prefect_Env\lib\asyncio\base_events.py", line 1859, in _run_once
    handle._run()
  File "\\v-tm-qeq-05\Prefect_Env\lib\asyncio\events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "\\v-tm-qeq-05\Prefect_Env\lib\site-packages\prefect\_internal\concurrency\calls.py", line 345, in _run_async
    result = await coro
  File "Script\pykx_asyncqconn_access_debug_copy.py", line 96, in async_query
    <http://jogger.info|jogger.info>(current_status)
Message: 'DISPATCHED Task: prepareDataAggIbesAis'