I have a similar but unresolved issue. I am routinely getting the error:
Service error: CalendarApp: Unrecognized content type:text/html
when running a script ot populate a gcalendar from a gdoc spreadsheet. Key points below :
* the calendar gets semi populated
* the breakpoint (where the calendar stops getting populated) appears to be random
* the incidence of this error has been increasing as the amount of data in teh spreadsheet to be copied has increased
* getting rid of a long free text field being copied into the description of the calendar has decreased incidence (I looked for special characters that could cause a break, but the random nature of the breakpoint does not suggest this, or that length is an issue, unless google is binning the data between cells in some dynamic way).
Below is the script that copies the data:
function calTest1() {
//var sheet = SpreadsheetApp.getActiveSheet();
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("toCal");
var startRow = 2; // First row of data to process
var numRows = sheet.getLastRow()-1; //4; // Number of rows to process
var dataRange = sheet.getRange(startRow, 1, numRows, 13);
var data = dataRange.getValues();
var cal = CalendarApp.getCalendarsByName("COM-Curric-Cal")[0];
for (i in data) {
var row = data[i];
//var courseNum = row[0]; // First column
var courseNum = row[3]; // First column
var discipline = row[1]; // Second column
var lecturer = row[2];
//var desc = row[0] + " - " + row[2]+ " \nCompetencies = " + row[12] ;
var tpyeCLE = row[4];
var sHrs = row[5];
var fHrs = row[6];
var tstart = row[7];
var tstop = row[8];
var loc = row[9];
//cal.createEvent(courseNum, new Date(tstart), new Date(tstop), {description:desc});
cal.createEvent(courseNum, new Date(tstart), new Date(tstop));
}
}