Hi all - I am working through the <Getting Started...
# prefect-community
a
Hi all - I am working through the Getting Started tutorial for Deployments using Prefect 2.4.5 via a Miniconda environment on Windows:
Copy code
name: prefect-service
channels:
  - defaults
dependencies:
  - python=3.9.13
  - pip=22.1.2
  - pip:
    - prefect==2.4.5
I am hitting an error after running
prefect deployment apply log_flow-deployment.yaml
:
Copy code
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000226A897BEE0>
... redacted for readability ...
RuntimeError: Event loop is closed
Any idea what is happening here? Please let me know if I can provide any additional info.
Full error message:
Copy code
Successfully loaded 'log-simple'
Deployment 'log-flow/log-simple' successfully created with id '2e3093b7-1da7-4ac1-8942-f3044e68d846'.
View Deployment in UI: <http://127.0.0.1:4200/deployment/2e3093b7-1da7-4ac1-8942-f3044e68d846>

To execute flow runs from this deployment, start an agent that pulls work from the 'test' work queue:
$ prefect agent start -q 'test'
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000226A897BEE0>
Traceback (most recent call last):
  File "C:\Users\austin\.conda\envs\prefect-service\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\austin\.conda\envs\prefect-service\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\austin\.conda\envs\prefect-service\lib\asyncio\base_events.py", line 751, in call_soon
    self._check_closed()
  File "C:\Users\austin\.conda\envs\prefect-service\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000226A897BEE0>
Traceback (most recent call last):
  File "C:\Users\austin\.conda\envs\prefect-service\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\austin\.conda\envs\prefect-service\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\austin\.conda\envs\prefect-service\lib\asyncio\base_events.py", line 751, in call_soon
    self._check_closed()
  File "C:\Users\austin\.conda\envs\prefect-service\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
n
hmm - what does your
prefect deployment build
command look like?
a
I believe it's equivalent to the command in the tutorial:
Copy code
prefect deployment build ./log_flow.py:log_flow -n log-simple -q test
Found flow 'log-flow'
Default '.prefectignore' file written to B:\prefect-tutorial\.prefectignore
Deployment YAML created at 'B:\prefect-tutorial\log_flow-deployment.yaml'.
Deployment storage None does not have upload capabilities; no files uploaded.  Pass --skip-upload to suppress this
warning.
n
does it make a difference if you pass
--apply
to the end of your
build
command?
Copy code
prefect deployment build ./log_flow.py:log_flow -n log-simple -q test --apply
which circumvents the need to run
prefect deployment apply ...
at all
a
Interesting, yes it does! Running with
--apply
gives this output with no errors:
Copy code
Found flow 'log-flow'
Deployment YAML created at 'B:\prefect-tutorial\log_flow-deployment.yaml'.
Deployment storage None does not have upload capabilities; no files uploaded.  Pass --skip-upload to suppress this warning.
Deployment 'log-flow/log-simple2' successfully created with id 'd9bd944e-7c3f-4e42-a357-ba7ecaae9cee'.

To execute flow runs from this deployment, start an agent that pulls work from the 'test' work queue:
$ prefect agent start -q 'test'
n
weird.. in theory it should be the same whether you apply during the build or in 2 separate steps. In the case where you did it in two steps, did you edit the generated yaml at all before running
apply
?
a
Yes, I edited the yaml according to the tutorial:
Copy code
parameters: {'name': 'Marvin'}
schedule: null
infra_overrides:
  env:
    PREFECT_LOGGING_LEVEL: DEBUG
I also just tested without making any edits and I get the same error both ways
n
okay - could you please send the output of
prefect version
?
a
Copy code
Version:             2.4.5
API version:         0.8.1
Python version:      3.9.13
Git commit:          dbe27317
Built:               Thu, Sep 29, 2022 3:05 PM
OS/Arch:             win32/AMD64
Profile:             default
Server type:         hosted
n
thanks!