Experimenting with Docker workers and running flow...
# ask-community
d
Experimenting with Docker workers and running flows with locally-hosted images. Running into a bug that seems related to keeping the local hosting, but I know little about this process. Any suggestions as to what's going on? Will leave extended traceback in Thread
Copy code
Successfully built 891ce7011bf3
Traceback (most recent call last):
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\docker\api\client.py", line 268, in _raise_for_status
    response.raise_for_status()
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: <http+docker://localnpipe/v1.43/images/sha256:891ce7011bf3bbe9789dd268b99df28e308d871190280ce406213a52941d566a/tag?tag=latest&repo=%2Fgoogleanalytics&force=0>

The above exception was the direct cause of the following exception:
Setup with
prefect deploy
Copy code
Would you like to build a custom Docker image for this deployment? [y/n] (n): y
? Would you like to use the Dockerfile in the current directory? [y/n] (y): y
? Repository name (e.g. your Docker Hub username): 
? Image name (WeeklyChannel): googleanalytics
? Image tag (latest): 
Image /googleanalytics:latest will be built.
? Would you like to push this image to a remote registry? [y/n] (n): n
Running deployment build steps...
Traceback
Copy code
---> 891ce7011bf3
Successfully built 891ce7011bf3
Traceback (most recent call last):
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\docker\api\client.py", line 268, in _raise_for_status
    response.raise_for_status()
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: <http+docker://localnpipe/v1.43/images/sha256:891ce7011bf3bbe9789dd268b99df28e308d871190280ce406213a52941d566a/tag?tag=latest&repo=%2Fgoogleanalytics&force=0>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\deployments\steps\core.py", line 124, in run_steps
    step_output = await run_step(step, upstream_outputs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\deployments\steps\core.py", line 95, in run_step
    result = await from_async.call_soon_in_new_thread(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\_internal\concurrency\calls.py", line 291, in aresult
    return await asyncio.wrap_future(self.future)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\_internal\concurrency\calls.py", line 315, in _run_sync
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\_internal\compatibility\deprecated.py", line 155, in wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect_docker\deployments\steps.py", line 211, in build_docker_image
    image.tag(repository=image_name, tag=tag)
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\docker\models\images.py", line 141, in tag
    return self.client.api.tag(self.id, repository, tag=tag, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\docker\utils\decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\docker\api\image.py", line 571, in tag
    self._raise_for_status(res)
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\docker\api\client.py", line 270, in _raise_for_status
    raise create_api_error_from_http_exception(e) from e
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\docker\errors.py", line 39, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation) from e
docker.errors.APIError: 400 Client Error for <http+docker://localnpipe/v1.43/images/sha256:891ce7011bf3bbe9789dd268b99df28e308d871190280ce406213a52941d566a/tag?tag=latest&repo=%2Fgoogleanalytics&force=0>: Bad Request ("invalid reference format")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\cli\_utilities.py", line 41, in wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\utilities\asyncutils.py", line 255, in coroutine_wrapper
    return call()
           ^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\_internal\concurrency\calls.py", line 382, in __call__
    return self.result()
           ^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\_internal\concurrency\calls.py", line 282, in result
    return self.future.result(timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\_internal\concurrency\calls.py", line 168, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures\_base.py", line 401, in __get_result
    raise self._exception
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\_internal\concurrency\calls.py", line 345, in _run_async
    result = await coro
             ^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\cli\deploy.py", line 292, in deploy
    await _run_single_deploy(
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\client\utilities.py", line 51, in with_injected_client
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\cli\deploy.py", line 595, in _run_single_deploy
    await run_steps(build_steps, step_outputs, print_function=app.console.print)
  File "C:\Users\dtarro\.virtualenvs\GoogleAnalyticsETL-rjp9XWgD\Lib\site-packages\prefect\deployments\steps\core.py", line 152, in run_steps
    raise StepExecutionError(f"Encountered error while running {fqn}") from exc
prefect.deployments.steps.core.StepExecutionError: Encountered error while running prefect_docker.deployments.steps.build_docker_image
An exception occurred.
Solved. Turns out I'm required to specify a repository name