ServerSelectionTimeoutError: 0.0.0.1:27017: timed out ...
Hello again friends:
While running
(llm-handbook-pyvenv.d) nmvega@ollama$ poetry poe run-digital-data-etl
I ran into this issue.
ServerSelectionTimeoutError: 0.0.0.1:27017: timed out (configured timeouts: socketTimeoutMS: 20000.0ms,
connectTimeoutMS: 20000.0ms), Timeout: 30s, Topology Description: <TopologyDescription id:
678853bffd5cd1e35fa88ac3, topology_type: Unknown, servers: [<ServerDescription ('0.0.0.1', 27017) server_type:
Unknown, rtt: None, error=NetworkTimeout('0.0.0.1:27017: timed out (configured timeouts: socketTimeoutMS:
20000.0ms, connectTimeoutMS: 20000.0ms)')>]>
Error: Sequence aborted after failed subtask 'run-digital-data-etl-maxime'
The complete standard error/output is further below. Things seem to progress until an attempt to connect to ('0.0.0.1', 27017) is made (... I'm unsure why 0.0.0.1 instead of 0.0.0.0). Not wanting to flood this ticked with screenshots, I do see the multiple pipeline run attempts in ZenML as shown:
Any ideas? What other information can I provide to help you! Thank you!
(llm-handbook-pyvenv.d) nmvega@ollama$ poetry poe run-digital-data-etl
Poe => poetry run python -m tools.run --run-etl --no-cache --etl-config-filename digital_data_etl_maxime_labonne.yaml
2025-01-15 19:33:02.832 | INFO | llm_engineering.settings:load_settings:94 - Loading settings from the ZenML secret store.
2025-01-15 19:33:03.018 | WARNING | llm_engineering.settings:load_settings:99 - Failed to load settings from the ZenML secret store. Defaulting to loading the settings from the '.env' file.
2025-01-15 19:33:03.043 | INFO | llm_engineering.infrastructure.db.mongo:__new__:20 - Connection to MongoDB with URI successful: mongodb://llm_engineering:[email protected]:27017
PyTorch version 2.4.0 available.
2025-01-15 19:33:03.997 | INFO | llm_engineering.infrastructure.db.qdrant:__new__:29 - Connection to Qdrant DB with URI successful: localhost:6333
Chromedriver is already installed.
USER_AGENT environment variable not set, consider setting it to identify your requests.
/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pydantic/_internal/_fields.py:201: UserWarning: Field name "json" in "MonitoringDatasetFormat" shadows an attribute in parent "Base"
warnings.warn(
sagemaker.config INFO - Not applying SDK defaults from location: /etc/xdg/sagemaker/config.yaml
sagemaker.config INFO - Not applying SDK defaults from location: /home/nmvega/.config/sagemaker/config.yaml
Load pretrained SentenceTransformer: sentence-transformers/all-MiniLM-L6-v2
Initiating a new run for the pipeline: digital_data_etl.
Not including stack component settings with key orchestrator.sagemaker.
Caching is disabled by default for digital_data_etl.
Using user: nmvega
Using stack: default
artifact_store: default
orchestrator: default
Dashboard URL for Pipeline Run: http://192.168.0.12:8237/runs/c350359e-cb64-4792-9baf-5c7866d4d8b5
Step get_or_create_user has started.
2025-01-15 19:33:19.257 | INFO | steps.etl.get_or_create_user:get_or_create_user:11 - Getting or creating user: Maxime Labonne
Failed to run step get_or_create_user after 1 retries. Exiting.
0.0.0.1:27017: timed out (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms), Timeout: 30s, Topology Description: <TopologyDescription id: 678853bffd5cd1e35fa88ac3, topology_type: Unknown, servers: [<ServerDescription ('0.0.0.1', 27017) server_type: Unknown, rtt: None, error=NetworkTimeout('0.0.0.1:27017: timed out (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms)')>]>
Traceback (most recent call last):
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/zenml/orchestrators/step_launcher.py", line 255, in launch
self._run_step(
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/zenml/orchestrators/step_launcher.py", line 377, in _run_step
self._run_step_without_step_operator(
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/zenml/orchestrators/step_launcher.py", line 462, in _run_step_without_step_operator
runner.run(
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/zenml/orchestrators/step_runner.py", line 187, in run
return_values = step_instance.call_entrypoint(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/zenml/steps/base_step.py", line 554, in call_entrypoint
return self.entrypoint(**validated_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/steps/etl/get_or_create_user.py", line 15, in get_or_create_user
user = UserDocument.get_or_create(first_name=first_name, last_name=last_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm_engineering/domain/base/nosql.py", line 82, in get_or_create
instance = collection.find_one(filter_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/collection.py", line 1495, in find_one
for result in cursor.limit(-1):
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/cursor.py", line 1243, in next
if len(self.__data) or self._refresh():
^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/cursor.py", line 1160, in _refresh
self.__send_message(q)
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/cursor.py", line 1039, in __send_message
response = client._run_operation(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/_csot.py", line 108, in csot_wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/mongo_client.py", line 1431, in _run_operation
return self._retryable_read(
^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/mongo_client.py", line 1540, in _retryable_read
return self._retry_internal(
^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/_csot.py", line 108, in csot_wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/mongo_client.py", line 1507, in _retry_internal
).run()
^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/mongo_client.py", line 2353, in run
return self._read() if self._is_read else self._write()
^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/mongo_client.py", line 2483, in _read
self._server = self._get_server()
^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/mongo_client.py", line 2439, in _get_server
return self._client._select_server(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/mongo_client.py", line 1322, in _select_server
server = topology.select_server(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/topology.py", line 368, in select_server
server = self._select_server(
^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/topology.py", line 346, in _select_server
servers = self.select_servers(
^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/topology.py", line 253, in select_servers
server_descriptions = self._select_servers_loop(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/python3.11/site-packages/pymongo/topology.py", line 303, in _select_servers_loop
raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: 0.0.0.1:27017: timed out (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms), Timeout: 30s, Topology Description: <TopologyDescription id: 678853bffd5cd1e35fa88ac3, topology_type: Unknown, servers: [<ServerDescription ('0.0.0.1', 27017) server_type: Unknown, rtt: None, error=NetworkTimeout('0.0.0.1:27017: timed out (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms)')>]>
Pipeline run digital_data_etl_run_2025_01_15_19_33_18 failed.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in _run_module_as_main:198 │
│ in _run_code:88 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/tools/run.py:200 in <module> │
│ │
│ 197 │
│ 198 │
│ 199 if __name__ == "__main__": │
│ ❱ 200 │ main() │
│ 201 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/click/core.py:1130 in __call__ │
│ │
│ 1127 │ │
│ 1128 │ def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Any: │
│ 1129 │ │ """Alias for :meth:`main`.""" │
│ ❱ 1130 │ │ return self.main(*args, **kwargs) │
│ 1131 │
│ 1132 │
│ 1133 class Command(BaseCommand): │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/click/core.py:1055 in main │
│ │
│ 1052 │ │ try: │
│ 1053 │ │ │ try: │
│ 1054 │ │ │ │ with self.make_context(prog_name, args, **extra) as ctx: │
│ ❱ 1055 │ │ │ │ │ rv = self.invoke(ctx) │
│ 1056 │ │ │ │ │ if not standalone_mode: │
│ 1057 │ │ │ │ │ │ return rv │
│ 1058 │ │ │ │ │ # it's not safe to `ctx.exit(rv)` here! │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/click/core.py:1404 in invoke │
│ │
│ 1401 │ │ │ echo(style(message, fg="red"), err=True) │
│ 1402 │ │ │
│ 1403 │ │ if self.callback is not None: │
│ ❱ 1404 │ │ │ return ctx.invoke(self.callback, **ctx.params) │
│ 1405 │ │
│ 1406 │ def shell_complete(self, ctx: Context, incomplete: str) -> t.List["CompletionItem"]: │
│ 1407 │ │ """Return a list of completions for the incomplete value. Looks │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/click/core.py:760 in invoke │
│ │
│ 757 │ │ │
│ 758 │ │ with augment_usage_errors(__self): │
│ 759 │ │ │ with ctx: │
│ ❱ 760 │ │ │ │ return __callback(*args, **kwargs) │
│ 761 │ │
│ 762 │ def forward( │
│ 763 │ │ __self, __cmd: "Command", *args: t.Any, **kwargs: t.Any # noqa: B902 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/tools/run.py:159 in main │
│ │
│ 156 │ │ pipeline_args["config_path"] = root_dir / "configs" / etl_config_filename │
│ 157 │ │ assert pipeline_args["config_path"].exists(), f"Config file not found: {pipeline │
│ 158 │ │ pipeline_args["run_name"] = f"digital_data_etl_run_{dt.now().strftime('%Y_%m_%d_ │
│ ❱ 159 │ │ digital_data_etl.with_options(**pipeline_args)(**run_args_etl) │
│ 160 │ │
│ 161 │ if run_export_artifact_to_json: │
│ 162 │ │ run_args_etl = {} │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/pipelines/pipeline_definition.py:1388 in __call__ │
│ │
│ 1385 │ │ │ return self.entrypoint(*args, **kwargs) │
│ 1386 │ │ │
│ 1387 │ │ self.prepare(*args, **kwargs) │
│ ❱ 1388 │ │ return self._run() │
│ 1389 │ │
│ 1390 │ def _call_entrypoint(self, *args: Any, **kwargs: Any) -> None: │
│ 1391 │ │ """Calls the pipeline entrypoint function with the given arguments. │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/pipelines/pipeline_definition.py:808 in _run │
│ │
│ 805 │ │ │ │ │ │ "`zenml login --local`." │
│ 806 │ │ │ │ │ ) │
│ 807 │ │ │ │
│ ❱ 808 │ │ │ deploy_pipeline( │
│ 809 │ │ │ │ deployment=deployment, stack=stack, placeholder_run=run │
│ 810 │ │ │ ) │
│ 811 │ │ │ if run: │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/pipelines/run_utils.py:161 in deploy_pipeline │
│ │
│ 158 │ │ │ # status to `Failed` │
│ 159 │ │ │ publish_failed_pipeline_run(placeholder_run.id) │
│ 160 │ │ │
│ ❱ 161 │ │ raise e │
│ 162 │ finally: │
│ 163 │ │ constants.SHOULD_PREVENT_PIPELINE_EXECUTION = previous_value │
│ 164 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/pipelines/run_utils.py:145 in deploy_pipeline │
│ │
│ 142 │ constants.SHOULD_PREVENT_PIPELINE_EXECUTION = True │
│ 143 │ try: │
│ 144 │ │ stack.prepare_pipeline_deployment(deployment=deployment) │
│ ❱ 145 │ │ stack.deploy_pipeline( │
│ 146 │ │ │ deployment=deployment, │
│ 147 │ │ │ placeholder_run=placeholder_run, │
│ 148 │ │ ) │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/stack/stack.py:820 in deploy_pipeline │
│ │
│ 817 │ │ │ deployment: The pipeline deployment. │
│ 818 │ │ │ placeholder_run: An optional placeholder run for the deployment. │
│ 819 │ │ """ │
│ ❱ 820 │ │ self.orchestrator.run( │
│ 821 │ │ │ deployment=deployment, stack=self, placeholder_run=placeholder_run │
│ 822 │ │ ) │
│ 823 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/orchestrators/base_orchestrator.py:249 in run │
│ │
│ 246 │ │ │ logger.debug("Skipping client-side caching.") │
│ 247 │ │ │
│ 248 │ │ try: │
│ ❱ 249 │ │ │ if metadata_iterator := self.prepare_or_run_pipeline( │
│ 250 │ │ │ │ deployment=deployment, │
│ 251 │ │ │ │ stack=stack, │
│ 252 │ │ │ │ environment=environment, │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/orchestrators/local/local_orchestrator.py:78 in │
│ prepare_or_run_pipeline │
│ │
│ 75 │ │ │ │ │ step_name, │
│ 76 │ │ │ │ ) │
│ 77 │ │ │ │
│ ❱ 78 │ │ │ self.run_step( │
│ 79 │ │ │ │ step=step, │
│ 80 │ │ │ ) │
│ 81 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/orchestrators/base_orchestrator.py:281 in run_step │
│ │
│ 278 │ │ │ step=step, │
│ 279 │ │ │ orchestrator_run_id=self.get_orchestrator_run_id(), │
│ 280 │ │ ) │
│ ❱ 281 │ │ launcher.launch() │
│ 282 │ │
│ 283 │ @staticmethod │
│ 284 │ def requires_resources_in_orchestration_environment( │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/orchestrators/step_launcher.py:255 in launch │
│ │
│ 252 │ │ │ │ │ │ │ │ │ return None │
│ 253 │ │ │ │ │ │ │ │ │
│ 254 │ │ │ │ │ │ │ │ force_write_logs = _bypass │
│ ❱ 255 │ │ │ │ │ │ │ self._run_step( │
│ 256 │ │ │ │ │ │ │ │ pipeline_run=pipeline_run, │
│ 257 │ │ │ │ │ │ │ │ step_run=step_run, │
│ 258 │ │ │ │ │ │ │ │ last_retry=last_retry, │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/orchestrators/step_launcher.py:377 in _run_step │
│ │
│ 374 │ │ │ │ │ last_retry=last_retry, │
│ 375 │ │ │ │ ) │
│ 376 │ │ │ else: │
│ ❱ 377 │ │ │ │ self._run_step_without_step_operator( │
│ 378 │ │ │ │ │ pipeline_run=pipeline_run, │
│ 379 │ │ │ │ │ step_run=step_run, │
│ 380 │ │ │ │ │ step_run_info=step_run_info, │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/orchestrators/step_launcher.py:462 in │
│ _run_step_without_step_operator │
│ │
│ 459 │ │ if last_retry: │
│ 460 │ │ │ os.environ[ENV_ZENML_IGNORE_FAILURE_HOOK] = "false" │
│ 461 │ │ runner = StepRunner(step=self._step, stack=self._stack) │
│ ❱ 462 │ │ runner.run( │
│ 463 │ │ │ pipeline_run=pipeline_run, │
│ 464 │ │ │ step_run=step_run, │
│ 465 │ │ │ input_artifacts=input_artifacts, │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/orchestrators/step_runner.py:187 in run │
│ │
│ 184 │ │ │ │
│ 185 │ │ │ step_failed = False │
│ 186 │ │ │ try: │
│ ❱ 187 │ │ │ │ return_values = step_instance.call_entrypoint( │
│ 188 │ │ │ │ │ **function_params │
│ 189 │ │ │ │ ) │
│ 190 │ │ │ except BaseException as step_exception: # noqa: E722 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/zenml/steps/base_step.py:554 in call_entrypoint │
│ │
│ 551 │ │ │ │ "pydantic error above for more details." │
│ 552 │ │ │ ) from e │
│ 553 │ │ │
│ ❱ 554 │ │ return self.entrypoint(**validated_args) │
│ 555 │ │
│ 556 │ @property │
│ 557 │ def name(self) -> str: │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/steps/etl/get_or_create_user │
│ .py:15 in get_or_create_user │
│ │
│ 12 │ │
│ 13 │ first_name, last_name = utils.split_user_full_name(user_full_name) │
│ 14 │ │
│ ❱ 15 │ user = UserDocument.get_or_create(first_name=first_name, last_name=last_name) │
│ 16 │ │
│ 17 │ step_context = get_step_context() │
│ 18 │ step_context.add_output_metadata(output_name="user", metadata=_get_metadata(user_ful │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm_engineering/domain/base/ │
│ nosql.py:82 in get_or_create │
│ │
│ 79 │ def get_or_create(cls: Type[T], **filter_options) -> T: │
│ 80 │ │ collection = _database[cls.get_collection_name()] │
│ 81 │ │ try: │
│ ❱ 82 │ │ │ instance = collection.find_one(filter_options) │
│ 83 │ │ │ if instance: │
│ 84 │ │ │ │ return cls.from_mongo(instance) │
│ 85 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/collection.py:1495 in find_one │
│ │
│ 1492 │ │ if filter is not None and not isinstance(filter, abc.Mapping): │
│ 1493 │ │ │ filter = {"_id": filter} │
│ 1494 │ │ cursor = self.find(filter, *args, **kwargs) │
│ ❱ 1495 │ │ for result in cursor.limit(-1): │
│ 1496 │ │ │ return result │
│ 1497 │ │ return None │
│ 1498 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/cursor.py:1243 in next │
│ │
│ 1240 │ │ """Advance the cursor.""" │
│ 1241 │ │ if self.__empty: │
│ 1242 │ │ │ raise StopIteration │
│ ❱ 1243 │ │ if len(self.__data) or self._refresh(): │
│ 1244 │ │ │ return self.__data.popleft() │
│ 1245 │ │ else: │
│ 1246 │ │ │ raise StopIteration │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/cursor.py:1160 in _refresh │
│ │
│ 1157 │ │ │ │ self.__allow_disk_use, │
│ 1158 │ │ │ │ self.__exhaust, │
│ 1159 │ │ │ ) │
│ ❱ 1160 │ │ │ self.__send_message(q) │
│ 1161 │ │ elif self.__id: # Get More │
│ 1162 │ │ │ if self.__limit: │
│ 1163 │ │ │ │ limit = self.__limit - self.__retrieved │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/cursor.py:1039 in __send_message │
│ │
│ 1036 │ │ │ raise InvalidOperation("exhaust cursors do not support auto encryption") │
│ 1037 │ │ │
│ 1038 │ │ try: │
│ ❱ 1039 │ │ │ response = client._run_operation( │
│ 1040 │ │ │ │ operation, self._unpack_response, address=self.__address │
│ 1041 │ │ │ ) │
│ 1042 │ │ except OperationFailure as exc: │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/_csot.py:108 in csot_wrapper │
│ │
│ 105 │ │ │ if timeout is not None: │
│ 106 │ │ │ │ with _TimeoutContext(timeout): │
│ 107 │ │ │ │ │ return func(self, *args, **kwargs) │
│ ❱ 108 │ │ return func(self, *args, **kwargs) │
│ 109 │ │
│ 110 │ return cast(F, csot_wrapper) │
│ 111 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/mongo_client.py:1431 in _run_operation │
│ │
│ 1428 │ │ │ │ self, │
│ 1429 │ │ │ ) │
│ 1430 │ │ │
│ ❱ 1431 │ │ return self._retryable_read( │
│ 1432 │ │ │ _cmd, │
│ 1433 │ │ │ operation.read_preference, │
│ 1434 │ │ │ operation.session, │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/mongo_client.py:1540 in _retryable_read │
│ │
│ 1537 │ │ retryable = bool( │
│ 1538 │ │ │ retryable and self.options.retry_reads and not (session and session.in_trans │
│ 1539 │ │ ) │
│ ❱ 1540 │ │ return self._retry_internal( │
│ 1541 │ │ │ func, │
│ 1542 │ │ │ session, │
│ 1543 │ │ │ None, │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/_csot.py:108 in csot_wrapper │
│ │
│ 105 │ │ │ if timeout is not None: │
│ 106 │ │ │ │ with _TimeoutContext(timeout): │
│ 107 │ │ │ │ │ return func(self, *args, **kwargs) │
│ ❱ 108 │ │ return func(self, *args, **kwargs) │
│ 109 │ │
│ 110 │ return cast(F, csot_wrapper) │
│ 111 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/mongo_client.py:1507 in _retry_internal │
│ │
│ 1504 │ │ │ address=address, │
│ 1505 │ │ │ retryable=retryable, │
│ 1506 │ │ │ operation_id=operation_id, │
│ ❱ 1507 │ │ ).run() │
│ 1508 │ │
│ 1509 │ def _retryable_read( │
│ 1510 │ │ self, │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/mongo_client.py:2353 in run │
│ │
│ 2350 │ │ while True: │
│ 2351 │ │ │ self._check_last_error(check_csot=True) │
│ 2352 │ │ │ try: │
│ ❱ 2353 │ │ │ │ return self._read() if self._is_read else self._write() │
│ 2354 │ │ │ except ServerSelectionTimeoutError: │
│ 2355 │ │ │ │ # The application may think the write was never attempted │
│ 2356 │ │ │ │ # if we raise ServerSelectionTimeoutError on the retry │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/mongo_client.py:2483 in _read │
│ │
│ 2480 │ │ │
│ 2481 │ │ :return: Output for func()'s call │
│ 2482 │ │ """ │
│ ❱ 2483 │ │ self._server = self._get_server() │
│ 2484 │ │ assert self._read_pref is not None, "Read Preference required on read calls" │
│ 2485 │ │ with self._client._conn_from_server(self._read_pref, self._server, self._session │
│ 2486 │ │ │ conn, │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/mongo_client.py:2439 in _get_server │
│ │
│ 2436 │ │ │
│ 2437 │ │ :return: Abstraction to connect to server │
│ 2438 │ │ """ │
│ ❱ 2439 │ │ return self._client._select_server( │
│ 2440 │ │ │ self._server_selector, │
│ 2441 │ │ │ self._session, │
│ 2442 │ │ │ self._operation, │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/mongo_client.py:1322 in _select_server │
│ │
│ 1319 │ │ │ │ if not server: │
│ 1320 │ │ │ │ │ raise AutoReconnect("server %s:%s no longer available" % address) # │
│ 1321 │ │ │ else: │
│ ❱ 1322 │ │ │ │ server = topology.select_server( │
│ 1323 │ │ │ │ │ server_selector, │
│ 1324 │ │ │ │ │ operation, │
│ 1325 │ │ │ │ │ deprioritized_servers=deprioritized_servers, │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/topology.py:368 in select_server │
│ │
│ 365 │ │ operation_id: Optional[int] = None, │
│ 366 │ ) -> Server: │
│ 367 │ │ """Like select_servers, but choose a random server if several match.""" │
│ ❱ 368 │ │ server = self._select_server( │
│ 369 │ │ │ selector, │
│ 370 │ │ │ operation, │
│ 371 │ │ │ server_selection_timeout, │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/topology.py:346 in _select_server │
│ │
│ 343 │ │ deprioritized_servers: Optional[list[Server]] = None, │
│ 344 │ │ operation_id: Optional[int] = None, │
│ 345 │ ) -> Server: │
│ ❱ 346 │ │ servers = self.select_servers( │
│ 347 │ │ │ selector, operation, server_selection_timeout, address, operation_id │
│ 348 │ │ ) │
│ 349 │ │ servers = _filter_servers(servers, deprioritized_servers) │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/topology.py:253 in select_servers │
│ │
│ 250 │ │ │ server_timeout = server_selection_timeout │
│ 251 │ │ │
│ 252 │ │ with self._lock: │
│ ❱ 253 │ │ │ server_descriptions = self._select_servers_loop( │
│ 254 │ │ │ │ selector, server_timeout, operation, operation_id, address │
│ 255 │ │ │ ) │
│ 256 │
│ │
│ /home/nmvega/WORKSPACES.d/AGENTIC.GEN.AI.d/LLM.ENGINEERS.HANDBOOK.d/llm-handbook-pyvenv.d/lib64/ │
│ python3.11/site-packages/pymongo/topology.py:303 in _select_servers_loop │
│ │
│ 300 │ │ │ │ │ │ clientId=self.description._topology_settings._topology_id, │
│ 301 │ │ │ │ │ │ failure=self._error_message(selector), │
│ 302 │ │ │ │ │ ) │
│ ❱ 303 │ │ │ │ raise ServerSelectionTimeoutError( │
│ 304 │ │ │ │ │ f"{self._error_message(selector)}, Timeout: {timeout}s, Topology Des │
│ 305 │ │ │ │ ) │
│ 306 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ServerSelectionTimeoutError: 0.0.0.1:27017: timed out (configured timeouts: socketTimeoutMS: 20000.0ms,
connectTimeoutMS: 20000.0ms), Timeout: 30s, Topology Description: <TopologyDescription id:
678853bffd5cd1e35fa88ac3, topology_type: Unknown, servers: [<ServerDescription ('0.0.0.1', 27017) server_type:
Unknown, rtt: None, error=NetworkTimeout('0.0.0.1:27017: timed out (configured timeouts: socketTimeoutMS:
20000.0ms, connectTimeoutMS: 20000.0ms)')>]>
Error: Sequence aborted after failed subtask 'run-digital-data-etl-maxime'
```
Hi @iusztinpaul Might you have insight on this issue? I paused the book until resolved (the purist that I am ☺️), but may have move on. Thank you.
Hi @nmvega Hi I encountered the same issue. but after ensuring that Docker is running on my desktop, it is able to connect. The database runs on the docker image so we need the Docker service to be up in order to access the local database. Perhaps the infrastructure section in the README might help https://github.com/PacktPublishing/LLM-Engineers-Handbook?tab=readme-ov-file#%EF%B8%8F-infrastructure
To me, upgrading docker to the latest version and building images again by running poetry poe local-infrastructure-up helped me resolve this issue. I hope it would help you as well.