ServiceUnavailable:503失败,SSL握手失败:SSL_ERROR_SSL:error:1000007d:SSL例程:OPENSSL_internal:CERTIFICATE_VERIFY_FAQUE

im9ewurl  于 11个月前  发布在  其他
关注(0)|答案(1)|浏览(160)

我试图使用谷歌顶点人工智能预测模型。我试图预测一个数据点使用下面的代码。

from google.cloud import aiplatform

project_id = "project_id"
location = "us-central1"
endpoint_id = "399999999999999999"
ai_ep_client_options = {"api_endpoint": "us-central1-aiplatform.googleapis.com"}

os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = "service-key.json"

instance_list = [{"feature-1":"apple", "feature-2": "banana"}]

aiplatform_client = aiplatform.gapic.PredictionServiceClient(client_options=ai_ep_client_options)
prediction_endpoint_client = aiplatform_client.endpoint_path(project=project_id, location=location, endpoint=endpoint_id)

response = aiplatform_client.predict(endpoint=prediction_endpoint_client, instances=instance_list)

字符串
我得到下面的错误:
_InactiveRpcError Traceback(most recent call last)File ~\AppData\Local\anaconda3\Lib\site-packages\google\API_core\grpc_helpers.py:50,in *wrap_unary_errors..error_remapped_callable(*args,*kwargs)49 try:-> 50 return callable(*args,**kwargs)51 except grpc.RpcError as exc:
文件~\AppData\Local\anaconda3\Lib\site-packages\grpc_channel.py:1161,in _UnaryUnaryMultiCallable.call(self,request,timeout,metadata,credentials,wait_for_ready,compression)1155(1156 state,1157 call,1158)= self._blocking(1159 request,timeout,metadata,credentials,wait_for_ready,compression 1160)-> 1161 return _end_unary_response_blocking(state,call,False,None)
File ~\AppData\Local\anaconda3\Lib\site-packages\grpc_channel.py:1004,in _end_unary_response_blocking(state,call,with_call,deadline)1003 else:-> 1004 raise _InactiveRpcError(state)
_InactiveRpcError:<_InactiveRpcError of RPC that terminated with:status = StatusCode.UNAVAILABLE details =“failed to connect to all addresses; last error:UNKNOWN:ipv4:142.250.31.95:443:Ssl handshake failed:SSL_ERROR_SSL:error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILURE”debug_error_string =“UNKNOWN:failed to connect to all addresses; last error:UNKNOWN:ipv4:xxx. xxx.xxx.x:443:Ssl handshake failed:SSL_ERROR_SSL:error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAQUE {created_time:“2023-11-03T11:03:27.2979758+00:00”,grpc_status:14}”
上述异常是以下异常的直接原因:
服务不可用追溯(最近调用的最后一次)单元格[18],第16行13 aiplatform_client = aiplatform.gapic.PredictionServiceClient(client_options=ai_ep_client_options)14 prediction_endpoint_client = aiplatform_client.endpoint_path(project=project_id,location=location,endpoint=endpoint_id)-> 16 response = aiplatform_client.predict(endpoint=prediction_endpoint_client,instances=instance_list)17响应
File ~\AppData\Local\anaconda 3\Lib\site-packages\google\cloud\aiplatform_v1\services\prediction_service\client.py:602,in PredictionServiceClient.predict(self,request,endpoint,instances,parameters,retry,timeout,metadata)597 metadata = tuple(metadata)+(598 gapic_v1.routing_header.to_grpc_metadata(“endpoint”,request.endpoint),)),599)601 #发送请求。--> 602 response = rpc(603 request,604 retry=retry,605 timeout=timeout,606 metadata=metadata,607)609 #完成;返回响应。610返回响应
File ~\AppData\Local\anaconda3\Lib\site-packages\google\API_core\gapic_v1\method.py:154,in _GapicCallable.call(self,timeout,retry,*args,**kwargs)151 metadata.extend(self._metadata)152 kwargs[“metadata”] = metadata --> 154 return wraped_func(*args,**kwargs)
File ~\AppData\Local\anaconda3\Lib\site-packages\google\API_core\grpc_helpers.py:52,in *wrap_unary_errors..error_remapped_callable(*args,*kwargs)50 return callable(*args,**kwargs)51 except grpc.RpcError as exc:-> 52 raise exceptions.from_grpc_error(exc)from exc
服务不可用:503无法连接到所有地址;最后一个错误:未知:ipv4:xxx. xx.xx:443:Ssl握手失败:SSL_ERROR_SSL:错误:1000007 d:SSL例程:OPENSSL_internal:CERTIFICATE_VERIFY_FAQUE
我在“Windos”操作系统上运行这个。

aiplatform.__version__


返回1.28.1
我在我的公司机器上运行此代码。此代码几天前成功运行。但系统上进行了一些安全更新,从那时起,此错误开始出现。我只是ML/PythonMaven,我不知道网络的基础知识,安全证书,CA文件,.pem文件等。,
在我的研究中,我看到了一些类似问题的解决方案,但他们大多是在Linux/Unix系统上。建议在Windows上的一些解决方案。
我不确定这是一个网络/安全相关的问题还是一个GCP Python顶点AI问题。如果标签不相关,请原谅。

lh80um4z

lh80um4z1#

首先想到的是防火墙。由于您提到在此问题之前有安全更新,因此它可能重新配置了您的网络防火墙,阻止连接到您的Vertex AI服务。
关闭您的网络连接,以确保其不会拦截或修改您的SSL握手,同时,检查您的机器的证书,并确保它仍然有效,并没有过期。
请参阅此文档以使用Private Service Connect to access Vertex AI online predictions from on-premises
您也可以联系Vertex AI support获取详细帮助。

相关问题