gspread.exceptions.APIError error code 500 - python-3.x

I am using the python gspread library to get information off of google sheets. I have had no prior problems accessing any sheets but one sheet keeps throwing this error with doc.worksheet("{worksheet_name}") or doc.worksheets():
gspread.exceptions.APIError: {
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
I have ruled out the following possible causes:
program doesn't have access to the doc
too many worksheets in the doc
over api limit
I even created a copy of the doc and tried to access that and the same error occurred.

You can use a 100 second delay every 100 requests
Usage limit

Well, I had the same error. I just created another spreadsheet and it worked.

This error is caused because the data is large.You can improvise by uploading the data in chunks but you need to add rows to the sheet of the additional chunks and specify the range in the sheet you want to append the data
i.e
worksheet.update([[]]) #list of lists of first chunk
worksheet.add_rows() #number of rows you want to append
worksheet.update(range,[[]]) #range where you want to place the second chunk and list of the lists of the second chunk

Related

How do you iterate within an Azure Logic App Response component

I have an Azure MS SQL Server component that is returning multiple rows and feeding into a Response component.
The Body of the Response component looks like this:
{
"MyID":"#{body('Get_rows')['value'][1]['Id']}"
}
I can make the number in the bracket 0 and get the first result. I can make it 1 and get the second result. But what I am trying to find is the syntax to loop through all the results that are passed so that it would effectively provide the following (assuming there were 2 results total:
{
"MyID":"#{body('Get_rows')['value'][0]['Id']}"
}
{
"MyID":"#{body('Get_rows')['value'][1]['Id']}"
}
Thanks in advance for advice on where to find the correct syntax or for examples of correct syntax.
It took me a while but figured out that I needed to do two things:
I had to run a for each after the Get Rows and within that I created a Data Operations - Compose component. Within that I was able to create a single JSON object with all the parameters.
From there I used #outputs command as shown below in the Body of the Response and it inserted the array brackets and the commas to delimit the Compose entries automagically.
Here is what the code in the Body of the Response looks like:
#outputs('Compose')
Note that 'Compose' is the default name given to the first Compose component you place in the application.

UserErrorSqlBulkCopyInvalidColumnLength - Azure SQL Database

I am configuring a Salesforce to Azure SQL Database data copy using Azure Data Factory. There appears to be an issue with the column length, but I am unable to identify which column is actually causing an issue.
How can I gain more insight into exactly what is causing my problem? or what column is really invalid?
{
"dataRead":18560714,
"dataWritten":0,
"rowsRead":15514,
"rowsCopied":0,
"copyDuration":34,
"throughput":533.109,
"errors":[
{
"Code":9123,
"Message":"ErrorCode=UserErrorSqlBulkCopyInvalidColumnLength,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=SQL Bulk Copy failed due to received an invalid column length from the bcp client.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=The service has encountered an error processing your request. Please try again. Error code 4815.\r\nA severe error occurred on the current command. The results, if any, should be discarded.,Source=.Net SqlClient Data Provider,SqlErrorNumber=40197,Class=20,ErrorCode=-2146232060,State=1,Errors=[{Class=20,Number=40197,State=1,Message=The service has encountered an error processing your request. Please try again. Error code 4815.,},{Class=20,Number=0,State=0,Message=A severe error occurred on the current command. The results, if any, should be discarded.,},],'",
"EventType":0,
"Category":5,
"Data":{
},
"MsgId":null,
"ExceptionType":null,
"Source":null,
"StackTrace":null,
"InnerEventInfos":[
]
}
],
"effectiveIntegrationRuntime":"DefaultIntegrationRuntime (East US 2)",
"usedCloudDataMovementUnits":4,
"usedParallelCopies":1,
"executionDetails":[
{
"source":{
"type":"Salesforce"
},
"sink":{
"type":"AzureSqlDatabase"
},
"status":"Failed",
"start":"2018-03-01T18:07:37.5732769Z",
"duration":34,
"usedCloudDataMovementUnits":4,
"usedParallelCopies":1,
"detailedDurations":{
"queuingDuration":5,
"timeToFirstByte":24,
"transferDuration":4
}
}
]
}
"Message":"ErrorCode=UserErrorSqlBulkCopyInvalidColumnLength,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=SQL
Bulk Copy failed due to received an invalid column length from the bcp
client.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=The
service has encountered an error processing your request. Please try
again. Error code 4815.\r\nA severe error occurred on the current
command. The results, if any, should be
discarded.,Source=.Net SqlClient Data
Provider,SqlErrorNumber=40197,Class=20,ErrorCode=-2146232060,State=1,Errors=[{Class=20,Number=40197,State=1,Message=The service has encountered an error processing your request. Please try
again. Error code 4815.,},{Class=20,Number=0,State=0,Message=A severe
error occurred on the current command. The results, if any,
should be discarded.
I have seen that error when trying copy a string from the source to the destination but the column receiving the string on the destination is shorter than the source.
My suggestion is to make sure you selected data types big enough on the destination so they can receive the data from the source. Make sure also the sink has the columns shown in the preview.
To identify which column may be involved, exclude big columns one by one from the source.

Get usedrange of Microsoft Graph API doesn't work

I am trying to get values that are stored in Excel cells using the method Get usedrange (see the page below), but it doesn't work.
https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/worksheet_usedrange
The following error response is returned.
{
"error": {
"code": "InvalidArgument",
"message": "引数が正しくない、不足している、または形式が不適切です。", //The argument is incorrect, missing, or the format is inappropriate.
"innerError": {
"request-id": "dcff76b5-9bc6-4a01-b99f-853b9430ef0d",
"date": "2017-05-01T09:01:15"
}
}
}
I tried GET (as opposed to POST) with the same request URL on a trial ......it is mysterious that sometimes were time out, but sometimes all cell data was returned without timeout (result, the browser hung up).
I'd be very appreciated it if I could get any advise from anyone who encounters the same phenomenon or knows how to avoid it.
--
Additional Notes:
-Excel Data
-Execution result in Graph Explorer (original method, POST)
https://graph.microsoft.com/v1.0/me/drive/items/01PYKTZAO2B65SCU2UDJCKMKFWJEEDRNLQ/workbook/worksheets('Sheet1')/UsedRange()
-Additional Information - Result when use GET in the same URL
The author left a comment saying that they only expected metadata (such as the number of cells), but received all of the data in the range.
You can filter which information you'd like back like so:
/usedRange?$select=columnCount,rowCount,address,addressLocal,cellCount,columnIndex,rowIndex
(Doing this prevents the query from returning the actual data from the cells because it omits things like numberFormat, text, formulas, formulasLocal, formulasR1C1, valueTypes, and values.)

Specify columns in empty IQueryable in WCF Data Service?

I have a DataService with the following queryable:
public IQueryable<MyData> MyDataList => myDataList.AsQueryable();
I connect to this data service in Excel 2016. Everything works, but when the list is empty I get the following error message.
The query did not run or the Data Model could not be accessed.
Here's the error message we got:
An Evaluate statement cannot return a table without columns
It seems the client (Excel) needs an object to successfully determine the columns. Why? Is it possible to tell the client about the columns without the need for an object?
Can't you check the resulted query first to see if it contains anything and return the actual data or a default one?
var defaultList = new List<MyData>();
public IQueryable<MyData> MyDataList = (myDataList.Any())?myDataList.AsQueryable():defaultList.AsQueryable();

Core data/iCloud seeding with local xml file throwing errors in iOS8

Hopefully this is something simple but I haven't been able to track down a fix yet. I have an application that I'm trying to implement both iCloud and Core Data with. I'd like it to run on iOS7 and iOS8.
The application is a checklist/tableview application for collectibles.
Essentially, the application has an pre-seeded xml file with about 50,000 in it. The sqlite/core data is initially configured to have just 1 item. Users can, from a table view, select groups to add to the core data store (so that not all 50,000 items are included). When the user selects a group that has 1-50 items, it parses the xml for those items and writes them into the core data store. When a user selects a group that has a larger amount of files, it parses and adds them, but then also throws some random "no document at url" errors during the parsing process. The application doesn't crash, and all items seem to be added, but the application stops synching with iCloud. The exact error is:
__45-[PFUbiquityFilePresenter processPendingURLs]_block_invoke(439): CoreData: Ubiquity:
Librarian returned a serious error for starting downloads Error Domain=BRCloudDocsErrorDomain Code=5
"The operation couldn’t be completed. (BRCloudDocsErrorDomain error 5 - No document at URL)"
UserInfo=0x7fd7f54abea0 {NSDescription=No document at URL,
NSFilePath=/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848- 0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/C45FA553-6CA0-4C26-845B-B478EF7EAD60.1.cdt,
NSUnderlyingError=0x7fd7f54aa200 "The operation couldn’t be completed. No such file or directory"}
with userInfo {
NSDescription = "No document at URL";
NSFilePath = "/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/C45FA553-6CA0-4C26-845B-B478EF7EAD60.1.cdt";
NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed.
No such file or directory\" UserInfo=0x7fd7f5433240 {NSDescription=No such file or directory}";
} for these urls: (
"file:///Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile%20Documents/iCloud~com~xxxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/C45FA553-6CA0-4C26-845B-B478EF7EAD60.1.cdt"
)
Then I will get a "move" error as well (sometimes after the parse is complete):
[PFUbiquityTransactionLog moveFileToPermanentLocationWithError:](761): CoreData: Ubiquity:
CoreData: Ubiquity: Error writing export log to file: file:///Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile%20Documents/iCloud~com~xxxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt
error: Error Domain=NSCocoaErrorDomain Code=516 "The operation couldn’t be completed. (Cocoa error 516.)"
UserInfo=0x7fd7f49cdfd0 {NSSourceFilePathErrorKey=/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxx~xxxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/tempLogs.nosync/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt,
NSUserStringVariant=(
Move
), NSDestinationFilePath=/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt,
NSFilePath=/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxx~xxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/tempLogs.nosync/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt,
NSUnderlyingError=0x7fd7f497f430 "The operation couldn’t be completed. File exists"}
userInfo: {
NSDestinationFilePath = "/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxx~xxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt";
NSFilePath = "/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/tempLogs.nosync/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt";
NSSourceFilePathErrorKey = "/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/tempLogs.nosync/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt";
NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=17 \"The operation couldn\U2019t be completed. File exists\"";
NSUserStringVariant = (
Move
);
}
Any thoughts on how to fix this? Am I trying to make too many changes at once and that is crashing the core data/icloud synching? Any thoughts or pointers would be appreciated.
Zack
Zack, this isn't an answer (I don't have the rep to comment), but it might help you get on the right track. I'm implementing iCloud core data and am running into what looks like the same problem with iOS 8... same "No document at URL" error (no move error for me), and same breakdown in data sync. Two observations:
When I am running my app on two devices, core data sync initially works very well... like for a few minutes and a few updates. Then I get the "no document at URL" error.
My .sqlite database is very small and the updates I'm trying to make are modest (e.g. adding a single new entity), so I don't think file sizes or update complexity are factors.
On the device where these errors are logging, the store stops importing changes from iCloud. But changes I make on that device do continue to persist to the other device. So the effect is like a one-way breakdown.
Hope this helps. Would appreciate posts on any progress you make. I've been wrestling with this for several weeks and am close to giving up and shipping the app (which is universal) without iCloud data sync.

Resources