BUG in DBAbstraction v.16

27 views
Skip to first unread message

Federico Granata

unread,
May 7, 2014, 2:43:43 AM5/7/14
to excel-r...@googlegroups.com
I just update from version 15 to 16 of the dbabstraction library and now but while saving data to a sheet I got the error
 ReferenceError: "pPostData" non definito. (riga 77, file "Code", progetto "cUAMeasure")
so I had to rollback to v. 15

Bruce Mcpherson

unread,
May 7, 2014, 4:26:42 AM5/7/14
to excel-r...@googlegroups.com
any good now?


--
You received this message because you are subscribed to the Google Groups "Excel Liberation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excel-ramblin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Federico Granata

unread,
May 7, 2014, 4:40:14 AM5/7/14
to excel-r...@googlegroups.com
even worse
TypeError: Impossibile trovare la funzione generateUniqueString nell'oggetto [object Object]. (riga 27, file "Code", progetto "cUAMeasure")

and no line appended to my sheet ...

--
You received this message because you are subscribed to a topic in the Google Groups "Excel Liberation" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/excel-ramblings/zuqxnryBwIE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to excel-ramblin...@googlegroups.com.

Bruce Mcpherson

unread,
May 7, 2014, 4:42:04 AM5/7/14
to excel-r...@googlegroups.com
ok .. having difficulty tracking this down .. works fine with me. can you send me how you are creating the handler

Federico Granata

unread,
May 7, 2014, 4:50:33 AM5/7/14
to excel-r...@googlegroups.com
counters = {
now : 1,
totali: 2,
dettagliati: 3,
dettagliati_young: 4,
dettagliati_medium: 5,
dettagliati_old: 6,
dettagliati_sconosciuti: 7
}

  if(toSheet){
    var handler = new cDataHandler.DataHandler('Log',cDataHandler.dhConstants.DB.SHEET,undefined,"XXX");
    if (!handler.isHappy()) { 
    Logger.log ('couldnt open sheet:' + siloId + ' or spreadhseet:' + ssid);
  }
  var result;
  // make some new data
  result = handler.save(counters);
  if (result.handleError < 0) {
    Logger.log(JSON.stringify(result));
  }


Bruce Mcpherson

unread,
May 7, 2014, 5:13:58 AM5/7/14
to excel-r...@googlegroups.com
I just ran this and worked ok - nothing in your log? can you send me the execution transscript.. ,maybe a clue there,,

function driveTest11 () {

  var toSheet = true;
  var counters = {
now : 1,
totali: 2,
dettagliati: 3,
dettagliati_young: 4,
dettagliati_medium: 5,
dettagliati_old: 6,
dettagliati_sconosciuti: 7
};

  var ssid= "12pTwh5Wzg0W4ZnGBiUI3yZY8QFoNI8NNx_oCPynjGYY";
  if(toSheet){
    var handler = new cDataHandler.DataHandler('Log',cDataHandler.dhConstants.DB.SHEET,undefined, ssid);
    if (!handler.isHappy()) { 
    Logger.log ('couldnt open sheet:' + 'Log' + ' or spreadhseet:' + ssid);
    }
    var result;
    // make some new data
    result = handler.save(counters);
    if (result.handleError < 0) {
      Logger.log(JSON.stringify(result));
    }
  }
};

made this...

nowtotalidettagliatidettagliati_young dettagliati_mediumdettagliati_olddettagliati_sconosciuti
12 3456 7

Federico Granata

unread,
May 7, 2014, 5:27:34 AM5/7/14
to excel-r...@googlegroups.com
[14-05-07 11:23:16:482 CEST] Avvio dell'esecuzione
[14-05-07 11:23:16:616 CEST] Logger.log([countDB, []]) [0 secondi]
[14-05-07 11:23:16:639 CEST] ScriptDb.getMyDb() [0,023 secondi]
[14-05-07 11:23:16:640 CEST] ScriptDbInstance.query([{}]) [0 secondi]
[14-05-07 11:23:17:714 CEST] ScriptDbResult.getSize() [1,074 secondi]
[14-05-07 11:23:17:715 CEST] Logger.log([Portali totali: 9731, []]) [0 secondi]
[14-05-07 11:23:17:715 CEST] ScriptDbInstance.anyValue() [0 secondi]
[14-05-07 11:23:17:716 CEST] In.toString() [0 secondi]
[14-05-07 11:23:17:716 CEST] ScriptDbInstance.query([{dettagli={portalV2=In}}]) [0 secondi]
[14-05-07 11:23:17:911 CEST] ScriptDbResult.getSize() [0,195 secondi]
[14-05-07 11:23:17:911 CEST] Logger.log([Portali dettagliati: 1684, []]) [0 secondi]
[14-05-07 11:23:17:912 CEST] ScriptDbInstance.anyValue() [0 secondi]
[14-05-07 11:23:17:912 CEST] ScriptDbInstance.greaterThanOrEqualTo([1.399450997912E12]) [0 secondi]
[14-05-07 11:23:17:913 CEST] In.toString() [0 secondi]
[14-05-07 11:23:17:913 CEST] Relational.toString() [0 secondi]
[14-05-07 11:23:17:913 CEST] ScriptDbInstance.query([{dettagli={portalV2=In}, last=( X >= 1.399450997912E12)}]) [0 secondi]
[14-05-07 11:23:18:139 CEST] ScriptDbResult.getSize() [0,226 secondi]
[14-05-07 11:23:18:140 CEST] Logger.log([Portali dettagliati young: 24, []]) [0 secondi]
[14-05-07 11:23:18:140 CEST] ScriptDbInstance.anyValue() [0 secondi]
[14-05-07 11:23:18:141 CEST] ScriptDbInstance.greaterThanOrEqualTo([1.39943659814E12]) [0 secondi]
[14-05-07 11:23:18:141 CEST] In.toString() [0 secondi]
[14-05-07 11:23:18:141 CEST] Relational.toString() [0 secondi]
[14-05-07 11:23:18:141 CEST] ScriptDbInstance.query([{dettagli={portalV2=In}, last=( X >= 1.39943659814E12)}]) [0 secondi]
[14-05-07 11:23:18:339 CEST] ScriptDbResult.getSize() [0,197 secondi]
[14-05-07 11:23:18:339 CEST] Logger.log([Portali dettagliati medium: 74, []]) [0 secondi]
[14-05-07 11:23:18:340 CEST] ScriptDbInstance.anyValue() [0 secondi]
[14-05-07 11:23:18:340 CEST] ScriptDbInstance.greaterThanOrEqualTo([1.39936819834E12]) [0 secondi]
[14-05-07 11:23:18:341 CEST] In.toString() [0 secondi]
[14-05-07 11:23:18:341 CEST] Relational.toString() [0 secondi]
[14-05-07 11:23:18:341 CEST] ScriptDbInstance.query([{dettagli={portalV2=In}, last=( X >= 1.39936819834E12)}]) [0 secondi]
[14-05-07 11:23:18:556 CEST] ScriptDbResult.getSize() [0,215 secondi]
[14-05-07 11:23:18:557 CEST] Logger.log([Portali dettagliati old: 430, []]) [0 secondi]
[14-05-07 11:23:18:557 CEST] ScriptDbInstance.anyValue() [0 secondi]
[14-05-07 11:23:18:557 CEST] In.toString() [0 secondi]
[14-05-07 11:23:18:557 CEST] ScriptDbInstance.not([In]) [0 secondi]
[14-05-07 11:23:18:558 CEST] Not.toString() [0 secondi]
[14-05-07 11:23:18:558 CEST] ScriptDbInstance.query([{dettagli={portalV2=Not}}]) [0 secondi]
[14-05-07 11:23:19:278 CEST] ScriptDbResult.getSize() [0,719 secondi]
[14-05-07 11:23:19:278 CEST] Logger.log([Portali sconosciuti: 8047, []]) [0 secondi]
[14-05-07 11:23:19:279 CEST] PropertiesService.getScriptProperties() [0 secondi]
[14-05-07 11:23:19:288 CEST] (class).getProperty([uaKey]) [0,008 secondi]
[14-05-07 11:23:19:293 CEST] Esecuzione non riuscita: TypeError: Impossibile trovare la funzione generateUniqueString nell'oggetto [object Object]. (riga 27, file "Code", progetto "cUAMeasure") [2.676 secondi di esecuzione totale]

my full function is

function countDBToSheet(){
  countDB(true);
}

function countDB(toSheet){
  Logger.log("countDB");
  var toSheet=toSheet||false;
  var counters = {};
  counters.now = Date.now();
  var db = ScriptDb.getMyDb();
  var results = db.query({})/*.limit(1)*/;
  counters.totali=results.getSize();
  Logger.log("Portali totali: "+counters.totali);
  results = db.query({
    dettagli: {portalV2: db.anyValue()}
  });
  counters.dettagliati=results.getSize();
  Logger.log("Portali dettagliati: "+counters.dettagliati);
  results = db.query({
    dettagli: {portalV2: db.anyValue()},
    last: db.greaterThanOrEqualTo(Date.now()-setupValues.young)
  });
  counters.dettagliati_young=results.getSize();
  Logger.log("Portali dettagliati young: "+counters.dettagliati_young);
  results = db.query({
    dettagli: {portalV2: db.anyValue()},
    last: db.greaterThanOrEqualTo(Date.now()-setupValues.medium)
  });
  counters.dettagliati_medium=results.getSize();
  Logger.log("Portali dettagliati medium: "+counters.dettagliati_medium);
  results = db.query({
    dettagli: {portalV2: db.anyValue()},
    last: db.greaterThanOrEqualTo(Date.now()-setupValues.old)
  });
  counters.dettagliati_old=results.getSize();
  Logger.log("Portali dettagliati old: "+counters.dettagliati_old);
  results = db.query({
    dettagli: {portalV2: db.not(db.anyValue())}
  });
  counters.dettagliati_sconosciuti=results.getSize();
  Logger.log("Portali sconosciuti: "+counters.dettagliati_sconosciuti);
  
  if(toSheet){
    var handler = new cDataHandler.DataHandler('Log',cDataHandler.dhConstants.DB.SHEET,undefined,"1rQZ2G3A7dJzUnCIVDXUZpup38Y6tbzuQL-o0iCLYalw");
    if (!handler.isHappy()) { 
    Logger.log ('couldnt open sheet:' + siloId + ' or spreadhseet:' + ssid);
  }
  var result;
  // make some new data
  result = handler.save(counters);
  if (result.handleError < 0) {
    Logger.log(JSON.stringify(result));
  }
  }
}

Federico Granata

unread,
May 7, 2014, 5:32:44 AM5/7/14
to excel-r...@googlegroups.com
these are real data

now totalidettagliatidettagliati_young dettagliati_mediumdettagliati_olddettagliati_sconosciuti
139944726381996421652 1415391 7990
13994508639619656 16693550 4107987
1399454466129 9731168424 744318047

Bruce Mcpherson

unread,
May 7, 2014, 6:55:28 AM5/7/14
to excel-r...@googlegroups.com
ok .. i can see where it is going wrong but I dont know why. these are the arguments for datahandler - can you set the optOptOut to true when you create your handler...?

tableName,typeOfDb,optExpiry,optDriverSpecific,optDriverOb,optRandomSilo, optOptOut,optPeanut

Federico Granata

unread,
May 7, 2014, 7:22:50 AM5/7/14
to excel-r...@googlegroups.com
Like this ?
var handler = new cDataHandler.DataHandler('Log',cDataHandler.dhConstants.DB.SHEET,undefined,"1rQZ2G3A7dJzUnCIVDXUZpup38Y6tbzuQL-o0iCLYalw",undefined,undefined,true);

I don't see any change ... nothing new in the log nor in the transcription ...

Bruce Mcpherson

unread,
May 7, 2014, 7:24:42 AM5/7/14
to excel-r...@googlegroups.com
ok . thanks.. i'll see if i can reproduce it

bruce

Bruce Mcpherson

unread,
May 7, 2014, 7:48:24 AM5/7/14
to excel-r...@googlegroups.com
can you try just running this with the latest libraries. I've run it as another user and it works fine for me . interested to see if it works for you

function driveTest11 () {

  var toSheet = true;
  var counters = {
now : 1,
totali: 2,
dettagliati: 3,
dettagliati_young: 4,
dettagliati_medium: 5,
dettagliati_old: 6,
dettagliati_sconosciuti: 7
};

  var ssid= "12pTwh5Wzg0W4ZnGBiUI3yZY8QFoNI8NNx_oCPynjGYY";
  if(toSheet){
 
    var handler = new cDataHandler.DataHandler('Log',cDataHandler.dhConstants.DB.SHEET,undefined,ssid);
    if (!handler.isHappy()) { 
    Logger.log ('couldnt open sheet:' + 'Log' + ' or spreadhseet:' + ssid);
    }
    var result;
    // make some new data
    result = handler.save(counters);
    if (result.handleError < 0) {
      Logger.log(JSON.stringify(result));
    }
  }
};

Federico Granata

unread,
May 7, 2014, 8:27:56 AM5/7/14
to excel-r...@googlegroups.com
I tested it but I got the same error ...

Bruce Mcpherson

unread,
May 7, 2014, 9:08:41 AM5/7/14
to excel-r...@googlegroups.com
this is very peculiar .. i tried running as a completely different user and it worked.. ok.. will think some more

Federico Granata

unread,
May 7, 2014, 10:11:43 AM5/7/14
to excel-r...@googlegroups.com
I also try to create a brand new script just with your test function and I got the same error ...

Bruce Mcpherson

unread,
May 7, 2014, 10:34:18 AM5/7/14
to excel-r...@googlegroups.com
its the strangest thing. can you send me execution transscript again.. want to see if its the same place

Federico Granata

unread,
May 7, 2014, 10:41:36 AM5/7/14
to excel-r...@googlegroups.com
This one is from the new script (I create a script and a brand new spreadsheet)

[14-05-07 16:40:20:644 CEST] Avvio dell'esecuzione
[14-05-07 16:40:20:851 CEST] PropertiesService.getScriptProperties() [0 secondi]
[14-05-07 16:40:20:881 CEST] (class).getProperty([uaKey]) [0,025 secondi]
[14-05-07 16:40:20:888 CEST] Esecuzione non riuscita: TypeError: Impossibile trovare la funzione generateUniqueString nell'oggetto [object Object]. (riga 27, file "Code", progetto "cUAMeasure") [0.037 secondi di esecuzione totale]

Bruce Mcpherson

unread,
May 8, 2014, 6:14:25 AM5/8/14
to excel-r...@googlegroups.com
I've been able to replicate problem using a different account and a fresh script. It's very odd . I can see in the debugger that its using the wrong version (an old version) of one of the underlying libraries (cuameasure), but i have no idea why. will let you know when i've figured it out

bruce

Bruce Mcpherson

unread,
May 8, 2014, 6:18:39 AM5/8/14
to excel-r...@googlegroups.com
I deleted all the old versions of the underlying library, removed cdatahandler from my project, and added it again Mj61W-201_t_zC9fJg1IzYiz3TLx7pV4j (latest version), and all was good

bruce

Federico Granata

unread,
May 8, 2014, 6:23:34 AM5/8/14
to excel-r...@googlegroups.com
Cool !!!
Now I can use the latest version without blowing everything :D
Thank you very much :)
Reply all
Reply to author
Forward
0 new messages