Discuss Scratch

VIGARPAST_777
Scratcher
72 posts

scratchattach - A Scratch API wrapper (Python)


wvzack wrote:

Scrtachattach projects are currently getting these errors and im wondering if it is possible to just skip over them and keep going when they come up.

Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error
Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error 
ScratchAttach projects are currently getting these errors and I’m wondering if it is possible to just skip over them and keep going when they come up.

I’m working with **ScratchAttach** in Python to get information from Scratch projects. Sometimes the Scratch server does not respond correctly to cloud variable requests, which causes the program to stop. I want it to continue running even if these errors happen.

A simple way to handle this is using `try…except`:
from scratchattach.utils.exceptions import FetchError, APIError
try:
    username = str(client.get_requester()).lower()
except (FetchError, APIError) as e:
    print(f"Error retrieving information: {e}")
    username = None

Or a retry loop:

from time import sleep
for _ in range(3):
    try:
        username = str(client.get_requester()).lower()
        break
    except (FetchError, APIError):
        print("Error contacting Scratch, retrying...")
        sleep(2)
else:
    username = None

Full error example from ScratchAttach:

Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
data = requests.get(f"[https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}](https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset})", timeout=10).json()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
Requests.check_response(r)
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in **call**
output = self.on_call(*received_request.arguments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
username = str(client.get_requester()).lower()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
activity.load_log_data()
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error


VIGARPAST_777
Scratcher
72 posts

scratchattach - A Scratch API wrapper (Python)

I have a code that requires a username and password, not a session ID, but the problem is that I get logged out of my Scratch account, and when I log in to Scratch, the session in the code closes and it no longer works. How can I fix this?
TheCommCraft
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

(#3079)
Scrtachattach projects are currently getting these errors and im wondering if it is possible to just skip over them and keep going when they come up.

Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error
Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error 
I suspect that this means that the cloudlogs are just not available. Please create an issue on github.
kRxZy_kRxZy
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

Scrtachattach projects are currently getting these errors and im wondering if it is possible to just skip over them and keep going when they come up.

Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error
Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error 
scratch servers are unstable, this is why im not running my project scratch gpt
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

kRxZy_kRxZy wrote:

wvzack wrote:

Scrtachattach projects are currently getting these errors and im wondering if it is possible to just skip over them and keep going when they come up.

Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error
Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error 
scratch servers are unstable, this is why im not running my project scratch gpt
anyone found a fix? I think a service file would work but i cant get it to wrok
kRxZy_kRxZy
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

kRxZy_kRxZy wrote:

wvzack wrote:

Scrtachattach projects are currently getting these errors and im wondering if it is possible to just skip over them and keep going when they come up.

Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error
Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error 
scratch servers are unstable, this is why im not running my project scratch gpt
anyone found a fix? I think a service file would work but i cant get it to wrok
I dont think there is a fix, the error is with scratch or maybe after scratch cloud fixes they might of change the way of how data is sent or sonethin
_c1919
Scratcher
76 posts

scratchattach - A Scratch API wrapper (Python)

VIGARPAST_777 wrote:

I have a code that requires a username and password, not a session ID, but the problem is that I get logged out of my Scratch account, and when I log in to Scratch, the session in the code closes and it no longer works. How can I fix this?
Use a sessionID? That is the most logical solution I can think of
kRxZy_kRxZy
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

VIGARPAST_777 wrote:

I have a code that requires a username and password, not a session ID, but the problem is that I get logged out of my Scratch account, and when I log in to Scratch, the session in the code closes and it no longer works. How can I fix this?
Use an alt account, you don't need to be a scratcher on your alt account, for example I use Dev-Server
cone_as
Scratcher
43 posts

scratchattach - A Scratch API wrapper (Python)

kRxZy_kRxZy wrote:

VIGARPAST_777 wrote:

I have a code that requires a username and password, not a session ID, but the problem is that I get logged out of my Scratch account, and when I log in to Scratch, the session in the code closes and it no longer works. How can I fix this?
Use an alt account, you don't need to be a scratcher on your alt account, for example I use Dev-Server
That's smart but don't you need to be a scratcher to be able to modify cloud variables? Or have I missed something.
kRxZy_kRxZy
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

cone_as wrote:

kRxZy_kRxZy wrote:

VIGARPAST_777 wrote:

I have a code that requires a username and password, not a session ID, but the problem is that I get logged out of my Scratch account, and when I log in to Scratch, the session in the code closes and it no longer works. How can I fix this?
Use an alt account, you don't need to be a scratcher on your alt account, for example I use Dev-Server
That's smart but don't you need to be a scratcher to be able to modify cloud variables? Or have I missed something.
You dont need to be scratcher, scratch only blocks Scratchers on the website from using cloud variables, they don't block it from the cloud server
TechNerd64
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

_c1919 wrote:

VIGARPAST_777 wrote:

I have a code that requires a username and password, not a session ID, but the problem is that I get logged out of my Scratch account, and when I log in to Scratch, the session in the code closes and it no longer works. How can I fix this?
Use a sessionID? That is the most logical solution I can think of
Whenever I try logging in with username and password, it never works. I have to use sessionID

Last edited by TechNerd64 (Oct. 12, 2025 13:08:56)

wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

kRxZy_kRxZy wrote:

wvzack wrote:

kRxZy_kRxZy wrote:

wvzack wrote:

Scrtachattach projects are currently getting these errors and im wondering if it is possible to just skip over them and keep going when they come up.

Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error
Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error 
scratch servers are unstable, this is why im not running my project scratch gpt
anyone found a fix? I think a service file would work but i cant get it to wrok
I dont think there is a fix, the error is with scratch or maybe after scratch cloud fixes they might of change the way of how data is sent or sonethin
What I mean is a workaround, the error is not a fatal error it just prevents the server from responding. If you restarted your script and killled the old one whenever that happened it would be fine, I just dont know enough about this type of programing to do this.
N8_D_GR8_1
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

nvm

Last edited by N8_D_GR8_1 (Oct. 24, 2025 20:30:16)

kRxZy_kRxZy
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

kRxZy_kRxZy wrote:

wvzack wrote:

kRxZy_kRxZy wrote:

wvzack wrote:

Scrtachattach projects are currently getting these errors and im wondering if it is possible to just skip over them and keep going when they come up.

Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error
Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error 
scratch servers are unstable, this is why im not running my project scratch gpt
anyone found a fix? I think a service file would work but i cant get it to wrok
I dont think there is a fix, the error is with scratch or maybe after scratch cloud fixes they might of change the way of how data is sent or sonethin
What I mean is a workaround, the error is not a fatal error it just prevents the server from responding. If you restarted your script and killled the old one whenever that happened it would be fine, I just dont know enough about this type of programing to do this.
You would have to keep monitoring the server then.
You could just allow the error using:
import requests
url = "https://somerandomwebsite/api"
try:
    response = requests.get(url)
    response.raise_for_status()
except requests.exceptions.HTTPError as err:
    print(f"HTTP error occurred: {err}")
except requests.exceptions.ConnectionError as err:
    print(f"Connection error: {err}")
except requests.exceptions.Timeout as err:
    print(f"Timeout error: {err}")
except requests.exceptions.RequestException as err:
    print(f"An error occurred: {err}") 

Powered by DjangoBB