Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: langsmith client is failing because of internal JSONDecodeError #1501

Closed
realComlan opened this issue Feb 9, 2025 · 1 comment
Closed

Comments

@realComlan
Copy link

realComlan commented Feb 9, 2025

About three hours ago, I started having an error message when doing this

client.has_dataset(dataset_name="...")

The error message is

---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
[/usr/local/lib/python3.11/dist-packages/requests/models.py](https://localhost:8080/#) in json(self, **kwargs)
    973         try:
--> 974             return complexjson.loads(self.text, **kwargs)
    975         except JSONDecodeError as e:

[/usr/lib/python3.11/json/__init__.py](https://localhost:8080/#) in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    345             parse_constant is None and object_pairs_hook is None and not kw):
--> 346         return _default_decoder.decode(s)
    347     if cls is None:

[/usr/lib/python3.11/json/decoder.py](https://localhost:8080/#) in decode(self, s, _w)
    336         """
--> 337         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    338         end = _w(s, end).end()

[/usr/lib/python3.11/json/decoder.py](https://localhost:8080/#) in raw_decode(self, s, idx)
    354         except StopIteration as err:
--> 355             raise JSONDecodeError("Expecting value", s, err.value) from None
    356         return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

JSONDecodeError                           Traceback (most recent call last)
[<ipython-input-88-b472b8621eb9>](https://localhost:8080/#) in <cell line: 0>()
      1 dataset_name = "LangSmith Tour Multiplication"
----> 2 if not ls_client.has_dataset(dataset_name=dataset_name):
      3   dataset = ls_client.create_dataset(dataset_name=dataset_name)
      4 else:
      5   # Retrieval

[/usr/local/lib/python3.11/dist-packages/langsmith/client.py](https://localhost:8080/#) in has_dataset(self, dataset_name, dataset_id)
   3255         """
   3256         try:
-> 3257             self.read_dataset(dataset_name=dataset_name, dataset_id=dataset_id)
   3258             return True
   3259         except ls_utils.LangSmithNotFoundError:

[/usr/local/lib/python3.11/dist-packages/langsmith/utils.py](https://localhost:8080/#) in wrapper(*args, **kwargs)
    136                     f" {', '.join(invalid_group_names)}"
    137                 )
--> 138             return func(*args, **kwargs)
    139 
    140         return wrapper

[/usr/local/lib/python3.11/dist-packages/langsmith/client.py](https://localhost:8080/#) in read_dataset(self, dataset_name, dataset_id)
   3291             params=params,
   3292         )
-> 3293         result = response.json()
   3294         if isinstance(result, list):
   3295             if len(result) == 0:

[/usr/local/lib/python3.11/dist-packages/requests/models.py](https://localhost:8080/#) in json(self, **kwargs)
    976             # Catch JSON-related errors and raise as requests.JSONDecodeError
    977             # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
--> 978             raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
    979 
    980     @property

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@realComlan
Copy link
Author

There is currently an issue with the US instance of LangSmith. This is the cause of the JSONDecodeError.

Investigating - We are currently experiencing intermittent latency of up to one minute on run ingest. All submitted runs are being ingested but on a slight delay and some read operations against run IDs may 404 during the delay between ingest and appearance in the LangSmith UI.

We switched to the EU instance and it is working fine now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant