Discussion Forums  >  BT.com Website, Account Questions

Replies: 21    Views: 173

mercwonder
Aspiring developer
Profile
Posts: 41
Reg: Jan 21, 2012
Sacramento
2,910
03/20/12 11:35 AM (13 years ago)

Self Hosted Server

I have successfully uploaded and configured BT on my server. I created a new app and when I go to prepare package for download (iOS and Android) I receive the following message: Something Went Wrong. There was a problem parsing the JSON result? I have uninstalled and re-installed BT on my server. I have also read through the forum. I am at a loss.
 
Svartpaakvitt
Apple Fan
Profile
Posts: 63
Reg: Mar 03, 2012
Stavanger
7,130
like
03/20/12 11:59 AM (13 years ago)
I have exactly the same problem, looked in the forum, but I can´t find a solution which takes care of this. Hopefulle there are someone out there... Sorry I can´t help. Hope we can have a nearby solution. -Alf-
 
Parker @ buzztouch
buzztouch Evangelist
Profile
Posts: 1395
Reg: May 09, 2011
Pacific Grove, ...
24,500
like
03/20/12 12:10 PM (13 years ago)
Hi mercwonder, Go to your apps 'Core Properties" screen and view your apps Config Data. The first thing to check is that is loads. Then how long does it take? If it does load and it took less than about 30 seconds then we can test for the next possible issue. When you Config Data is completely loaded, copy it all and open up a web browser to http://jsonlint.com/ Run the validator and see if any issue come up. If there are some the validator should give you some sort of hint as to what is wrong. Be sure to test all of your Config Data as sometimes the validator will only process a limited amount of Data at once. If so you'll just need to re-copy and paste the Data that didn't get validated. If that whole process turn up 0 errors, the next thing to check for is the word "error". Open up your Config Data again. Do a search (command+f on mac, or ctrl+f on pc) and search for "error" without the quotes. If that term is found anywhere in your config Data you will have problems. Even if error is part of a larger word like "terror". So if you find "error" anywhere you'll have to replace it with something else. Let us know how this goes for ya.
 
Svartpaakvitt
Apple Fan
Profile
Posts: 63
Reg: Mar 03, 2012
Stavanger
7,130
like
03/20/12 12:21 PM (13 years ago)
I´m into this challenge myself. I got the message "Valid JSON", so that should be clear. In the "config.php´s" source code I find the following with "ERROR" from line 77: //turn error warning on / off... if(defined("APP_ERROR_REPORTING")){ if(APP_ERROR_REPORTING == "1"){ @error_reporting(E_ALL); @ini_set("display_errors", "1"); }else{ @error_reporting(0); @ini_set("display_errors", "0"); } }else{ @error_reporting(0); @ini_set("display_errors", "0"); } //php error handler.. function handleShutdown(){ $error = error_get_last(); if($error !== NULL) I´m quite useless at this moment... but I hope... -ALf-
 
mercwonder
Aspiring developer
Profile
Posts: 41
Reg: Jan 21, 2012
Sacramento
2,910
like
03/20/12 12:42 PM (13 years ago)
My JSON file shows active as well. I have the following ERRORs LINE 60: //echo "<br> " . mysql_error(); LINE 66: //echo "<br> " . mysql_error(); LINE 72: //echo "<br>" . mysql_error(); LINE 77 - 111: //turn error warning on / off... if(defined("APP_ERROR_REPORTING")){ if(APP_ERROR_REPORTING == "1"){ @error_reporting(E_ALL); @ini_set("display_errors", "1"); }else{ @error_reporting(0); @ini_set("display_errors", "0"); } }else{ @error_reporting(0); @ini_set("display_errors", "0"); } //php error handler.. function handleShutdown(){ $error = error_get_last(); if($error !== NULL){ // handle error..email it, print it, whatever floats your boat...the "info" variable holds the details... $info = "File: " . $error['file']; $info .= "<br/>Line: " . $error['line']; $info .= "<br/>Message: " . $error['message'] . PHP_EOL; echo "<div style='border:1px solid red;padding:10px;margin:10px;background-color:#FFFFFF;'>"; echo "Oops, a PHP error was trapped."; echo "<hr>"; echo $info; echo "<div>"; exit(); } } //register the php error handler... @register_shutdown_function('handleShutdown'); Hopefully that helps... I too am quite useless at this moment.
 
Frno
Lost but trying
Profile
Posts: 68
Reg: Mar 11, 2012
location unknow...
3,230
like
03/20/12 01:58 PM (13 years ago)
I am having the same issue. My guru says it is a false error and the code is actually being sent. Still need to fix.
 
Frno
Lost but trying
Profile
Posts: 68
Reg: Mar 11, 2012
location unknow...
3,230
like
03/20/12 03:25 PM (13 years ago)
OK Gang, the text below IS NOT me, obviously. This is my computer guru's work. See what you think. So, I had this same error and the other solutions posted didn't resolve my issue. Being a programmer, I took the challenge to get my hands dirty. After some debugging, I found my issue. When my application package was built, I was getting a JSON Success Message, but it was prepended by an Array of API data, which was causing the object to not be valid. Ex: Array ( [apiKey] => XXXXXXXXXXXXXXXXXXXXX [apiSecret] => XXXXXXXXXXXXXXXXXXXXXXXXxXX [command] => packageProject [appGuid] => XXXXXXXXXXXXXXXXXXXXXXXX [projectName] => MyProjName [appName] => MyAppName [iconURL] => MyIconURL.jpg [platform] => android [version] => 2.0 ) {"result":{"status":"success", "message":"The project was packaged successfully."}} Only the last part should have been returned for me. My solution: Clear out the variable before the response is returned in the 'bt_appDownload_AJAX.php' file (Full Location: bt-server\bt_v15\bt_app\bt_appDownload_AJAX.php). I inserted 'unset($jsonResult);' somewhere near line 852 and voila! My install is now working properly.
 
mercwonder
Aspiring developer
Profile
Posts: 41
Reg: Jan 21, 2012
Sacramento
2,910
like
03/20/12 09:39 PM (13 years ago)
Thanks for posting Frno... with that said, help me understand what you mean by "clear out the variable before the response..."
 
Frno
Lost but trying
Profile
Posts: 68
Reg: Mar 11, 2012
location unknow...
3,230
like
03/20/12 09:43 PM (13 years ago)
I have no idea, that was my computer guru friend on my account. I will ask him to log on and explain. Might be a day.
 
mercwonder
Aspiring developer
Profile
Posts: 41
Reg: Jan 21, 2012
Sacramento
2,910
like
03/20/12 09:44 PM (13 years ago)
Thank you so much... really appreciate it!
 
Frno
Lost but trying
Profile
Posts: 68
Reg: Mar 11, 2012
location unknow...
3,230
like
03/20/12 09:49 PM (13 years ago)
I just emailed him. He is sOmetimes a night owl. Maybe tonight? Never know.
 
mercwonder
Aspiring developer
Profile
Posts: 41
Reg: Jan 21, 2012
Sacramento
2,910
like
03/20/12 09:50 PM (13 years ago)
thanks again!
 
Frno
Lost but trying
Profile
Posts: 68
Reg: Mar 11, 2012
location unknow...
3,230
like
03/20/12 10:01 PM (13 years ago)
What can sometimes happen with PHP is that variables will retain values that have previously been set. For example: I say $number = 1. 20 Lines later, I say $number = 2. Sometimes, 1 will be retained and/or added to the total value. That is what I noticed. The variable, $jsonResult, is retaining what was previously stored in it earlier in the script. To fix this, I added the line 'unset($jsonResult);' which basically blanks out that value before it is reused.
 
mercwonder
Aspiring developer
Profile
Posts: 41
Reg: Jan 21, 2012
Sacramento
2,910
like
03/20/12 10:03 PM (13 years ago)
So just to confirm, you didn't remove the second variable, you simply blanked it out with 'unset($jsonResult);' ?
 
Svartpaakvitt
Apple Fan
Profile
Posts: 63
Reg: Mar 03, 2012
Stavanger
7,130
like
03/21/12 01:07 AM (13 years ago)
Well, this solution did not make it better for me. I copied the unset($jsonResult); and pasted it into the line 852, but I still got the JSON message. I hope I did understand this right, because I can see into the code it´s probably around here th problem is. But I´m quite new in this coding so I can´t see what may be wrong. -Alf-
 
Frno
Lost but trying
Profile
Posts: 68
Reg: Mar 11, 2012
location unknow...
3,230
like
03/21/12 04:50 AM (13 years ago)
So, the real key is this: Around line 850 or so, you will see a line of code resembling this: $jsonResult = \"{"result":\"; The unset command needs to go before this line. If the problem continues for you, you may have found a different issue. If this is still the case, let me know. Maybe I can help out with your specific issue.
 
Svartpaakvitt
Apple Fan
Profile
Posts: 63
Reg: Mar 03, 2012
Stavanger
7,130
like
03/21/12 04:57 AM (13 years ago)
I dit find the line, and put the command inside, uploaded via FTP but still the same problem continue. No change at all... -Alf- By the way here are my "lines" starting at line 848 continue to the end, which shows where I fit put the phrase. }//bolPassed }//bolPassed //prepare JSON result... unset($jsonResult); $jsonResult = "{\"result\":"; //passed or not? if($bolPassed){ $jsonResult .= "{\"status\":\"success\", \"message\":\"The project was packaged successfully.\"}"; }else{ $jsonResult .= "{\"status\":\"error\", \"message\":\"<br>" . $strMessage . "\"}"; } //end JSON result... $jsonResult .= "}"; //print the json... echo $jsonResult; exit(); ?>
 
Frno
Lost but trying
Profile
Posts: 68
Reg: Mar 11, 2012
location unknow...
3,230
like
03/21/12 06:18 AM (13 years ago)
Then you have found a different issue, it would seem. You will need to do some debugging to see what response you are getting whenever you try to build your package. In my case, I was getting a successful return but it was appearing as an error. You may actually be getting an error.
 
Svartpaakvitt
Apple Fan
Profile
Posts: 63
Reg: Mar 03, 2012
Stavanger
7,130
like
03/21/12 06:21 AM (13 years ago)
And then it stops for me. I don´t have the knowledge to do those operations. Do you have an easy instruction (step by step) to do the debugging? Anyway - thnx. -Alf-
 
Svartpaakvitt
Apple Fan
Profile
Posts: 63
Reg: Mar 03, 2012
Stavanger
7,130
like
03/21/12 06:48 AM (13 years ago)
To Parker: I suddenly understood it was in the Config Data URL I was going to check the word "error". I first believed I had to check it an other place. Now I´ve done that check, and the word "error" is not shown in the Config Data URL. Do you have any other solutions? -Alf-
 
mercwonder
Aspiring developer
Profile
Posts: 41
Reg: Jan 21, 2012
Sacramento
2,910
like
03/21/12 05:36 PM (13 years ago)
Tried to enter 'unset($jsonResult);' on line 852 and tried to set app for download... it gave me another JSON error... grrrrr
 
Parker @ buzztouch
buzztouch Evangelist
Profile
Posts: 1395
Reg: May 09, 2011
Pacific Grove, ...
24,500
like
03/22/12 06:38 PM (13 years ago)
Hi guys, Please see this and comment on that thread if it doesn't work for you. http://www.buzztouch.com/forum/thread.php?fid=24FB00FBA70BCFD7D26F09A
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.