argilla
argilla copied to clipboard
[BUG-python/deployment] SSL Certificate Verify Failed When Instancing httpx_extra_kwargs={"verify": False}
Describe the bug When instancing httpx_extra_kwargs={"verify": False} on rg.init, still getting a SSL_CERTIFICATE_VERIFY_FAILED when using rg.load_dataset_settings()
Stacktrace and Code to create the bug
settings = rg.load_dataset_settings("my_dataset", "my_workspace")
ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)
Expected behavior
# Operate through labels within the same dataset
settings.label_schema
# Perform further operations
Add a new label: settings.label_schema.add("new_label")
Remove a label: settings.label_schema.remove("label_to_remove")
Get all labels: labels = settings.label_schema.get_all()
Check if a label exists: exists = settings.label_schema.contains("label_name")
Environment:
- Argilla Version [1.21.0]
- Databricks
Additional context The httpx_extra_kwargs parameter is used to provide additional arguments to the httpx library when making HTTP requests using the {"verify": False} argument in httpx_extra_kwargs, specifying that SSL certificate verification should be disabled, not verifying the SSL certificate of the server.
As we're working with sensitive data within a corporate domain, when making HTTP request SSL certificate verification would be verified by default. Our hypothesis would be that a previous issue was solved regarding this problem, but it hasn't migrated into these processes as attribute.
🤖
Hey there @avecillajota! Nice to cross paths again in the digital realm. Hope this message finds you coding well! 🚀
Thank you for providing detailed information about the issue you're facing. The SSL_CERTIFICATE_VERIFY_FAILED error you're encountering is likely due to the fact that the httpx_extra_kwargs={"verify": False} argument is not being used in the httpx.Client instance that is used to send requests to Argilla.
In the provided context, the httpx.Client instance is passed to the RemoteFeedbackDataset class during initialization, but there's no evidence that the httpx_extra_kwargs argument is being used when creating this httpx.Client instance.
Unfortunately, without the code that creates the httpx.Client instance and initializes the RemoteFeedbackDataset, it's impossible to provide a definitive solution. However, you should ensure that the httpx.Client instance is created with verify=False if you want to disable SSL certificate verification. Here's an example:
import httpx
client = httpx.Client(verify=False)
rg.init(client=client)
Please note that disabling SSL certificate verification can expose you to security risks, such as man-in-the-middle attacks. It's generally recommended to keep SSL certificate verification enabled. If you're having issues with SSL certificate verification, it might be better to try to resolve those issues (for example, by making sure that your system's certificate store is up to date) rather than disabling verification entirely.
Regarding your question about the rg.init function in Argilla v1.21.0 supporting the httpx_extra_kwargs argument, yes, it does. This is evident from the __init__ method of the Argilla class in the src/argilla/client/client.py file. The httpx_extra_kwargs argument is included in the method signature and is passed to the AuthenticatedClient constructor.
Here is the relevant code:
def __init__(
self,
api_url: Optional[str] = None,
api_key: Optional[str] = None,
workspace: Optional[str] = None,
timeout: int = 120,
extra_headers: Optional[Dict[str, str]] = None,
httpx_extra_kwargs: Optional[Dict[str, Any]] = None,
):
...
self._client: AuthenticatedClient = AuthenticatedClient(
base_url=api_url,
token=api_key,
timeout=timeout,
headers=headers.copy(),
httpx_extra_kwargs=httpx_extra_kwargs,
)
...
This shows that httpx_extra_kwargs is an optional argument that can be passed to the rg.init function (which initializes an Argilla instance), and it is used to pass extra keyword arguments to the httpx.Client constructor.
I hope this helps! If you have any other questions or need further clarification, please don't hesitate to ask.
Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
"mydataset" corresponds to DatasetForTokenClassification
This issue is stale because it has been open for 90 days with no activity.
This issue was closed because it has been inactive for 30 days since being marked as stale.