Henry Bruce
08/21/2024, 7:17 PMFileNotFoundError: [WinError 2] The system cannot find the file specified
(I'm obviously doing this on a Windows machine). Full stack trace in the thread. Appreciate any guidance!Henry Bruce
08/21/2024, 7:18 PMC:\Users\Henry bruce>prefect config view
20:05:28.752 | DEBUG | prefect.profiles - Using profile 'ephemeral'
PREFECT_PROFILE='ephemeral'
PREFECT_API_KEY='********' (from profile)
PREFECT_API_URL='<https://api.prefect.cloud/api/accounts/XXX/workspaces/XXX>' (from profile)
PREFECT_LOGGING_LEVEL='DEBUG' (from profile)
PREFECT_SERVER_ALLOW_EPHEMERAL_MODE='True' (from profile)
C:\Users\Henry bruce>prefect work-pool create --type azure-container-instance:push --provision-infra una-workpool-qa-rg
20:05:38.213 | DEBUG | prefect.profiles - Using profile 'ephemeral'
20:05:38.563 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/XXX/workspaces/XXX/>
20:05:41.308 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/XXX/workspaces/XXX/>
Traceback (most recent call last):
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\cli\_utilities.py", line 42, in wrapper
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\cli\_types.py", line 153, in sync_fn
return asyncio.run(async_fn(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\cli\work_pool.py", line 181, in create
template_contents = await provisioner.provision(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\client\utilities.py", line 103, in with_injected_client
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\infrastructure\provisioners\container_instance.py", line 882, in provision
await self._verify_az_ready()
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\infrastructure\provisioners\container_instance.py", line 199, in _verify_az_ready
await self.azure_cli.run_command("az --version", ignore_if_exists=True)
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\site-packages\prefect\infrastructure\provisioners\container_instance.py", line 88, in run_command
result = await run_process(shlex.split(command), check=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\site-packages\anyio\_core\_subprocesses.py", line 58, in run_process
async with await open_process(
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\site-packages\anyio\_core\_subprocesses.py", line 131, in open_process
return await get_async_backend().open_process(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\site-packages\anyio\_backends\_asyncio.py", line 2270, in open_process
process = await asyncio.create_subprocess_exec(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\asyncio\subprocess.py", line 222, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 1708, in subprocess_exec
transport = await self._make_subprocess_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\asyncio\windows_events.py", line 399, in _make_subprocess_transport
transp = _WindowsSubprocessTransport(self, protocol, args, shell,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_subprocess.py", line 36, in __init__
self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\asyncio\windows_events.py", line 873, in _start
self._proc = windows_utils.Popen(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\asyncio\windows_utils.py", line 153, in __init__
super().__init__(args, stdin=stdin_rfd, stdout=stdout_wfd,
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Henry bruce\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
An exception occurred.
C:\Users\Henry bruce>az --version
azure-cli 2.63.0
core 2.63.0
telemetry 1.1.0
Dependencies:
msal 1.30.0
azure-mgmt-resource 23.1.1
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\Henry bruce\.azure\cliextensions'
Python (Windows) 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]
Legal docs and information: <http://aka.ms/AzureCliLegal|aka.ms/AzureCliLegal>
Your CLI is up-to-date.
C:\Users\Henry bruce>
Henry Bruce
08/21/2024, 7:19 PMHenry Bruce
08/22/2024, 7:50 AMMarvin
08/22/2024, 7:50 AMHenry Bruce
08/22/2024, 7:50 AMMarvin
08/22/2024, 7:51 AMHenry Bruce
08/22/2024, 7:52 AMFileNotFoundError: [WinError 2] The system cannot find the file specified
error.Marvin
08/22/2024, 7:53 AMFileNotFoundError: [WinError 2] The system cannot find the file specified
error related to automatic infrastructure provisioning on Azure ACI. However, here are some potential causes and solutions based on common issues when working with Azure and Prefect:
1. Azure CLI Installation:
Ensure that the Azure CLI is installed and properly set up on your machine. You can install it from the Azure CLI Installation Guide.
2. Path Configuration:
Make sure that the Azure CLI executable is included in your system's PATH environment variable. This can typically be done by modifying the environment variables on your operating system.
3. Command Execution:
Ensure that the commands you are trying to run via Prefect are executable through the command line. Test running the commands manually in your terminal to verify.
4. Prefect ACI Worker Setup:
Follow the detailed setup instructions for configuring the ACI work pool and verify each step. Here is the link to the setup guide for Prefect Azure ACI Worker.
Could you please verify these points and let me know if that resolves the issue? If not, please provide more details about the context in which you're encountering this error.Henry Bruce
08/22/2024, 2:17 PM