Skip to content

GCS Bucket subdirectory not being creating while using ReasoningEngine create method #3650

Closed
@ItsMeAbby

Description

Error:

404 Can not copy from "gs://aretec-vertex-lc-stagging/reasoning_engine/reasoning_engine.pkl" to "gs://1006586376595-996210311323189248-1713810220200/code.pkl", check if the source object and target bucket exist.

image

Environment details

  • OS type and version: windows 10
  • Python version: 3.9.18
  • pip version: 23.3
  • google-cloud-aiplatform version: 1.48.0
  • langchain-google-vertexai version: 1.0.1

Steps to reproduce

  1. Init Vertex AI Client
  2. Create reasoning Engine Instance
  3. Deploy

Code example

import vertexai
from vertexai.preview import reasoning_engines

vertexai.init(
    project="PROJECT_ID",
    location="LOCATION",
    staging_bucket="gs://BUCKET_NAME",
)

DISPLAY_NAME = "Demo Langchain Application"

remote_app = reasoning_engines.ReasoningEngine.create(
    reasoning_engines.LangchainAgent(
        model=model,
        tools=[get_exchange_rate],
        model_kwargs=model_kwargs,
    ),
    requirements=[
        "google-cloud-aiplatform",
        "langchain",
        "langchain-core",
        "langchain-google-vertexai",
        "requests==2.*",
    ],
    display_name=DISPLAY_NAME,
)

Stack trace

Using bucket aretec-vertex-lc-stagging
Writing to gs://aretec-vertex-lc-stagging/reasoning_engine/reasoning_engine.pkl
Writing to gs://aretec-vertex-lc-stagging/reasoning_engine/requirements.txt
Creating in-memory tarfile of extra_packages
Writing to gs://aretec-vertex-lc-stagging/reasoning_engine/dependencies.tar.gz
failed to generate schema: issubclass() arg 1 must be a class
Creating ReasoningEngine
Create ReasoningEngine backing LRO: projects/1006586376595/locations/us-central1/reasoningEngines/996210311323189248/operations/8928551772121726976

{
	"name": "NotFound",
	"message": "404 Can not copy from \"gs://aretec-vertex-lc-stagging/reasoning_engine/reasoning_engine.pkl\" to \"gs://1006586376595-996210311323189248-1713810220200/code.pkl\", check if the source object and target bucket exist. 5: Can not copy from \"gs://aretec-vertex-lc-stagging/reasoning_engine/reasoning_engine.pkl\" to \"gs://1006586376595-996210311323189248-1713810220200/code.pkl\", check if the source object and target bucket exist.",
	"stack": "---------------------------------------------------------------------------
NotFound                                  Traceback (most recent call last)
Cell In[8], line 3
      1 DISPLAY_NAME = \"Demo Langchain Application\"
----> 3 remote_app = reasoning_engines.ReasoningEngine.create(
      4     reasoning_engines.LangchainAgent(
      5         model=model,
      6         model_kwargs=model_kwargs,
      7     ),
      8     requirements=[
      9         \"google-cloud-aiplatform\",
     10         \"langchain\",
     11         \"langchain-core\",
     12         \"langchain-google-vertexai\",
     13         \"requests==2.*\",
     14     ],
     15     display_name=DISPLAY_NAME,
     16 )
     17 # 1006586376595-3067866139913617408-1713803998746
     18 # remote_app

File d:\\miniconda3\\envs\\vector\\lib\\site-packages\\vertexai\\reasoning_engines\\_reasoning_engines.py:284, in ReasoningEngine.create(cls, reasoning_engine, requirements, reasoning_engine_name, display_name, description, gcs_dir_name, sys_version, extra_packages)
    272 operation_future = sdk_resource.api_client.create_reasoning_engine(
    273     parent=initializer.global_config.common_location_path(
    274         project=sdk_resource.project, location=sdk_resource.location
   (...)
    281     ),
    282 )
    283 _LOGGER.log_create_with_lro(cls, operation_future)
--> 284 created_resource = operation_future.result()
    285 _LOGGER.log_create_complete(
    286     cls,
    287     created_resource,
    288     cls._resource_noun,
    289     module_name=\"vertexai.preview.reasoning_engines\",
    290 )
    291 # We use `._get_gca_resource(...)` instead of `created_resource` to
    292 # fully instantiate the attributes of the reasoning engine.

File d:\\miniconda3\\envs\\vector\\lib\\site-packages\\google\\api_core\\future\\polling.py:261, in PollingFuture.result(self, timeout, retry, polling)
    256 self._blocking_poll(timeout=timeout, retry=retry, polling=polling)
    258 if self._exception is not None:
    259     # pylint: disable=raising-bad-type
    260     # Pylint doesn't recognize that this is valid in this case.
--> 261     raise self._exception
    263 return self._result

NotFound: 404 Can not copy from \"gs://aretec-vertex-lc-stagging/reasoning_engine/reasoning_engine.pkl\" to \"gs://1006586376595-996210311323189248-1713810220200/code.pkl\", check if the source object and target bucket exist. 5: Can not copy from \"gs://aretec-vertex-lc-stagging/reasoning_engine/reasoning_engine.pkl\" to \"gs://1006586376595-996210311323189248-1713810220200/code.pkl\", check if the source object and target bucket exist."
}

https://cloud.google.com/vertex-ai/generative-ai/docs/reasoning-engine/deploy

Metadata

Assignees

Labels

api: vertex-aiIssues related to the googleapis/python-aiplatform API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions