-
Notifications
You must be signed in to change notification settings - Fork 8
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
Why my json response back from local host is always empty? #12
Comments
@66deft123456 Hi! Could you please try some other examples like |
Actually most of these examples show the same error that shows requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0) and others include problems about some missing packages. The 404 issue is solved through adding the route entry. Thank you! So I am confused that whether the examples should include ‘/v1/session’ but it still fails when I add ‘/v1/session’. |
No, the example should not include |
|
|
Get it. I guess you may not set the environment variables ( |
After executing source .env and restarting the service, I noticed that the local service automatically disconnects after a period of time. For example, shortly after I run python3 examples/write_recommendation_letter.py, the output is as shown in the image below. However, after a long period of time, it throws an error. However, after a long period of time, it throws an error. **Task was destroyed but it is pending! During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): 2025-02-07 03:37:34,312 - Public API - ERROR - Remove session error in http://localhost:9000. Error: HTTPConnectionPool(host='localhost', port=9000): Max retries exceeded with url: /v1/session/0 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9f02eee5f0>: Failed to establish a new connection: [Errno 111] Connection refused')) During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
I reconfigured the environment completely and strictly according to the README, started the service, and tried to run the write_recommendation_letter.py script. However, the result is still the same as yesterday. |
@66deft123456 Hi, I reconfigured the environment from scratch following the documentation in my local environment and don't meet the problem you encountered. Can you example the The real cause of the error may be in the stdout file rather than in the log. Also, you can run the |
root@v02e09045:/workspace/parrotserve/ParrotServe# python3 examples/write_recommendation_letter.py
2025-01-24 02:57:01,530 - Interface - WARNING - Use a conversation template ConversationTemplate to transform the function. This only works well for requests which are dispatched to engines with the corresponding models.
2025-01-24 02:57:01,531 - PFunc VM - INFO - VM (session_id=NONE) registers function: write_recommendation_letter
2025-01-24 02:57:01,531 - PFunc VM - INFO - VM (session_id=NONE) runs program: main
2025-01-24 02:57:01,534 - PFunc VM - INFO - VM registered a Session (session_id=0).
2025-01-24 02:57:01,535 - PFunc VM - INFO - VM (session_id=0) submits SemanticCall: write_recommendation_letter
2025-01-24 02:57:01,537 - Public API - ERROR - Submit semantic call (session_id=0) error in http://localhost:9000. Error: Expecting value: line 1 column 1 (char 0)
Error happens when executing Parrot program: <class 'requests.exceptions.JSONDecodeError'> JSONDecodeError('Expecting value: line 1 column 1 (char 0)')
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/workspace/parrotserve/ParrotServe/parrot/frontend/pfunc/vm.py", line 402, in running_scope
yield
File "/workspace/parrotserve/ParrotServe/parrot/frontend/pfunc/vm.py", line 454, in run
program(*args)
File "/workspace/parrotserve/ParrotServe/examples/write_recommendation_letter.py", line 21, in main
letter = letter_generator(
File "/workspace/parrotserve/ParrotServe/parrot/frontend/pfunc/function.py", line 328, in call
return self._call_func(*args, **kwargs)
File "/workspace/parrotserve/ParrotServe/parrot/frontend/pfunc/function.py", line 355, in _call_func
param_info = self._submit_semantic_call(call)
File "/workspace/parrotserve/ParrotServe/parrot/frontend/pfunc/function.py", line 277, in _submit_semantic_call
return BasicFunction._virtual_machine_env.submit_semantic_call_handler(call)
File "/workspace/parrotserve/ParrotServe/parrot/frontend/pfunc/vm.py", line 197, in submit_semantic_call_handler
resp = submit_semantic_call(
File "/workspace/parrotserve/ParrotServe/parrot/protocol/public/apis.py", line 141, in submit_semantic_call
raise e
File "/workspace/parrotserve/ParrotServe/parrot/protocol/public/apis.py", line 129, in submit_semantic_call
return send_http_request(
File "/workspace/parrotserve/ParrotServe/parrot/protocol/http_utils.py", line 48, in send_http_request
resp_data = error_resp.json()
File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2025-01-24 02:57:01,540 - PFunc VM - INFO - VM unregistered its Session (session_id=0).
The text was updated successfully, but these errors were encountered: