BoxAPIException Message: None, Status 500 error
AnsweredI am running a script I wrote to verify that a directory on my local computer matches a folder on box. The folder is very large and failed mid-upload so I am trying to have my script upload the rest of the data that didn't upload when it failed.
The relevant python function is shown below.
"def CheckFileDiffs(InputDir, boxDir_ID, client, oldTime):
# Check if client needs to be updated
curTime = time.time()
if (curTime - oldTime > 1200):
print("\n****REQUESTING NEW CLIENT****")
print("Old Time: " + str(oldTime))
print("Cur Time: " + str(curTime))
print("Time Diff: " + str((curTime - oldTime) / 60))
client, oldTime = refreshClient()
# Get local files and directories in input directory
_, dirnames, filenames = next(os.walk(InputDir))
# Get Box files and directories in input directory
items = client.folder(folder_id=boxDir_ID).get_items(limit=1000)
boxNameList = []
boxIDList = []
temp_int = 1
# print("Box File List")
for item in items:
boxNameList.append(item.name)
boxIDList.append(item.id)
print(temp_int)
print('{0} {1} is named "{2}"\n'.format(item.type.capitalize(), item.id, item.name))
temp_int = temp_int + 1
# print("Missing Files")
for localFile in filenames:
foundFlag = 0
for boxFile in boxNameList:
if(localFile == boxFile):
foundFlag = 1
break
if (foundFlag == 0):
client.folder(boxDir_ID).upload(InputDir + localFile)
print(localFile)
# print("\nMissing Directories")
for localFolder in dirnames:
foundFlag = 0
for i in range(0, len(boxNameList)):
boxFolder = boxNameList[i]
boxFolderID = boxIDList[i]
if(localFolder == boxFolder):
foundFlag = 1
matchingID = boxFolderID
break
if (foundFlag == 0):
UploadFolder(InputDir + localFolder + '/', boxDir_ID, client,
oldTime)
print(localFolder + '/')
else:
CheckFileDiffs(InputDir + localFolder + '/', boxFolderID, client,
oldTime)
return"
The end of the output from my script is shown below. The number corresponds to the the number of the following item in the current box directory. The error does not seem to include any identifying information.
"...
178993
Folder 135620017807 is named "8.48758"
178994
Folder 135711297777 is named "8.4876"
178995
Folder 135493099513 is named "8.48772"
178996
Folder 135214981371 is named "8.4878"
178997
Folder 135265143845 is named "8.48792"
178998
Folder 135482464613 is named "8.48799"
178999
Folder 135690522090 is named "8.48811"
179000
Folder 135754905626 is named "8.48813"
"GET https://api.box.com/2.0/folders/135169036418/items?limit=1000&offset=169000" 500 0
{'Date': 'Fri, 02 Jul 2021 14:17:28 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '1453af828dd4c729a809dd22430047b82'}
b''
"GET https://api.box.com/2.0/folders/135169036418/items?limit=1000&offset=171000" 500 0
{'Date': 'Fri, 02 Jul 2021 14:17:42 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '041a61b767a4ea67ba0c67bb122961490'}
b''
"GET https://api.box.com/2.0/folders/135169036418/items?limit=1000&offset=175000" 500 0
{'Date': 'Fri, 02 Jul 2021 14:18:04 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '03a12cd8ccaf9084a72d0e638fd530245'}
b''
"GET https://api.box.com/2.0/folders/135169036418/items?limit=1000&offset=176000" 500 0
{'Date': 'Fri, 02 Jul 2021 14:18:12 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '1615e3150e640eb6a8e70e8e51ba1e7f4'}
b''
"GET https://api.box.com/2.0/folders/135169036418/items?limit=1000&offset=176000" 500 0
{'Date': 'Fri, 02 Jul 2021 14:18:16 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '07be3504a72e83bf34a39ec6161f4ade2'}
b''
"GET https://api.box.com/2.0/folders/135169036418/items?limit=1000&offset=178000" 500 0
{'Date': 'Fri, 02 Jul 2021 14:18:32 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '048031334a6abaff9d47931f4f0d8a3e6'}
b''
"GET https://api.box.com/2.0/folders/135169036418/items?limit=1000&offset=178000" 500 0
{'Date': 'Fri, 02 Jul 2021 14:18:36 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '0c45bce43a6f622d6d2f2cf695896d26f'}
b''
"GET https://api.box.com/2.0/folders/135169036418/items?limit=1000&offset=178000" 500 0
{'Date': 'Fri, 02 Jul 2021 14:18:42 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '0f2714e1ed5e21e7b81a8dfa84804392f'}
b''
"GET https://api.box.com/2.0/folders/135169036418/items?limit=1000&offset=178000" 500 0
{'Date': 'Fri, 02 Jul 2021 14:18:48 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '0e4b575e758d30ef6f5abf87f66221939'}
b''
"GET https://api.box.com/2.0/folders/135169036418/items?limit=1000&offset=178000" 500 0
{'Date': 'Fri, 02 Jul 2021 14:19:02 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '01fef6557f847ae1dea14deab67fd98b4'}
b''
"GET https://api.box.com/2.0/folders/135169036418/items?limit=1000&offset=178000" 500 0
{'Date': 'Fri, 02 Jul 2021 14:19:13 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '0c2c38a79906dbfb69e0934b0ae15c3fa'}
b''
Traceback (most recent call last):
File "FolderCompare.py", line 98, in <module>
CheckFileDiffs(BasePath, BasePathID, client, oldTime)
File "FolderCompare.py", line 76, in CheckFileDiffs
oldTime)
File "FolderCompare.py", line 76, in CheckFileDiffs
oldTime)
File "FolderCompare.py", line 42, in CheckFileDiffs
for item in items:
File "/home/engineering/anaconda3/lib/python3.7/site-packages/boxsdk/pagination/box_object_collection.py", line 97, in next
return next(self._all_items)
File "/home/engineering/anaconda3/lib/python3.7/site-packages/boxsdk/pagination/box_object_collection.py", line 107, in _items_generator
response_object = self._load_next_page()
File "/home/engineering/anaconda3/lib/python3.7/site-packages/boxsdk/pagination/box_object_collection.py", line 143, in _load_next_page
box_response = self._session.get(self._url, params=params)
File "/home/engineering/anaconda3/lib/python3.7/site-packages/boxsdk/session/session.py", line 102, in get
return self.request('GET', url, **kwargs)
File "/home/engineering/anaconda3/lib/python3.7/site-packages/boxsdk/session/session.py", line 158, in request
response = self._prepare_and_send_request(method, url, **kwargs)
File "/home/engineering/anaconda3/lib/python3.7/site-packages/boxsdk/session/session.py", line 406, in _prepare_and_send_request
self._raise_on_unsuccessful_request(network_response, request)
File "/home/engineering/anaconda3/lib/python3.7/site-packages/boxsdk/session/session.py", line 329, in _raise_on_unsuccessful_request
network_response=network_response
boxsdk.exception.BoxAPIException: Message: None
Status: 500
Code: None
Request ID: None
Headers: {'Date': 'Fri, 02 Jul 2021 14:19:13 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'BOX-REQUEST-ID': '0c2c38a79906dbfb69e0934b0ae15c3fa'}
URL: https://api.box.com/2.0/folders/135169036418/items
Method: GET
Context Info: None"
Any assistance in debugging this error would be immensely helpful.
-
Official comment
Hi Michael!
Can you actually file a support ticket? You'll receive quicker service that way!
Thanks,
Alex, Box Developer Advocate
Comment actions
Please sign in to leave a comment.
Comments
1 comment