A couple times when trying to deploy I got an erro...
# pacc-may-31-2023
l
A couple times when trying to deploy I got an error
'NoneType' object has no attribute 'split'
without any other useful info. does anyone have advice?
👀 1
e
Hmm… that’s an odd one. Mind posting the full stack trace?
l
hmm that was all I got
Copy code
prefect deploy -n "prefect_104.py:test-deployment"

'NoneType' object has no attribute 'split'
I don't quite remember what my deployment.yaml looked like at the time but maybe something wasn't filled in
e
Ah… so you’ll want to do one of the following:
Copy code
prefect deploy prefect_104.py:<name of your flow function>
or
Copy code
prefect deploy -n "test-deployment"
l
ohh ok so the name flag is only for if you've aliased the flow?
e
Yeah, it allows you to reference the deployment by the deployment name (not the flow name).
l
prefect deploy prefect_104.py:test_deployment -n n ew-deployment
Copy code
if not flow_name and not base_deploy["flow_name"] and not entrypoint:
                             ~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'flow_name'
Copy code
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/prefect/cli/_utilities.py", line 41, in wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 260, in coroutine_wrapper
    return call()
           ^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 245, in __call__
    return self.result()
           ^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 173, in result
    return self.future.result(timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/opt/homebrew/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 218, in _run_async
    result = await coro
             ^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/prefect/cli/root.py", line 286, in deploy
    if not flow_name and not base_deploy["flow_name"] and not entrypoint:
                             ~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'flow_name'
for anyone reading this without context, I think it makes sense now 🙂 but we discussed some parts about the deployment arguments and associated error messaging that were a bit confusing
👍 1
specifically that in
prefect deploy var1.py:var2 -n var3
var2 is the name of the flow but var3 is the name given to a deployment of that flow, of which there can be many -- both in the deployment.yaml or through CLI.. and that there are a few different configuration fields called "name"
also you can ignore the keyerror issue, I was on prefect-2.10.2 and didn't notice as everything was backward compatible until just now
👍 2