Discussion Forums  >  Self Hosted Control Panels

Replies: 12    Views: 81

nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
03/05/13 06:01 AM (12 years ago)

Self hosted BT 2.1.8 - bt_config.txt empty

Hi guys, I have a issue with generating app. I update from 2.1.7 to 2.1.8 and manually update all plugins. After that I create new app and download source open in xCode and run simulator and receive error "The configuration data for this applications is invalid" so I check bt_config.txt and there is message from hostgator eror 404 page not found. I check in control panel for app if is everything ok with configuration data and in JSON data there is no configuration it is empty. What can be wrong any idea? Thx
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
03/05/13 09:42 AM (12 years ago)
Hi nickrick32, I'm checking into this for you.
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
03/05/13 09:51 AM (12 years ago)
thank you ian if you need some additional information's please let me know
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/05/13 11:30 AM (12 years ago)
"hostgator eror 404 page not found" Clearly the issue here. 404 is a web server response for, well, a page it cannot find. I would be suspect of the cURL function that runs during the app packaging process. Have a look at BT-server/bt_v15/bt_app/bt_appDownload_AJAX.php this is the file that fetches the config.txt data from your server and includes it in the package you download. The method that does this is called fnGetConfigData() and begins on line 290 of this file. I'll bet this function isn't working as expected. I'll also bet it has something to do with how Host Gator does, or does not setup the cURL functions and host configuration file in their apache config. Complicated stuff.
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
03/05/13 11:44 AM (12 years ago)
Hi David, I can contact hostgator support to check with them and it will be great if you can tell me what to ask them
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/05/13 11:58 AM (12 years ago)
You'll probably not get far asking Host Gator support to debug / diagnose your web app. Not sure really. They may offer custom diagnosis for web apps, they may not. Do this.. Download this .txt file http://www.buzztouch.com/system/bt_appDownload_AJAX-ALT.txt Copy it's contents and replace the contents of your BT-server/bt_v15/bt_app/bt_appDownload_AJAX.php file. This is an alternative version of that same file. The only difference is the way the fnGetConfigData() works. Upload it to your server... Visit your control panel and download an app - see if the config.txt file is "empty." I'll bet it's not. If it works, it confirms the Apache Config file on the Host Gator machine will not let you run the cURL function in the previous file. I'll add some details to this post about why / how this is working after the webinar that starts in :03 minutes :-)
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
03/05/13 12:29 PM (12 years ago)
awesome thank you David it works now thank you so much :)
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
03/05/13 12:39 PM (12 years ago)
Ahhhh nice:)
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/05/13 01:14 PM (12 years ago)
Just ended webinar..I'll add a bit to this before jumping into next meeting. The issue. And this gets complex. Ignore these ideas if it goes beyond your understanding or interest level. 1) Your self hosted software has an /api folder. This API folder is used in cases when a device, or anyone for that matter "needs to get data" from your control panel for your app. The most common task for this /api folder is to produce the config.txt file for an app. When you click "refresh" on the device, it calls this /api folder to fetch the config.txt data. 2) When you download the source code for an app, you need the latest copy of the config.txt data included in that download. So, the package process uses this same /api folder to grab the data. Makes sense. The phone needs the config.txt data or the the control panel needs the config.txt data, they both use the same routine to get it. BUT, and this is where the host / backend configuration comes in to play. When the device asks for this data, or you do (by pasting the dataURL in your address bar in your browser) you're making an HTTP request for it. A standard request, just like asking for a webpage. Hit the URL, the /api folder returns the config.txt data. Easy. However, your control panel cannot seem to do this. When you make the same HTTP request using cURL it fails. There are literally countless things that could cause this and even more depending on how the host has setup the Apache environment. The bottom line is, it's far easier to just NOT use cURL to get the config.txt data than it is to try to explain to a far-away web host how their Apache HTTP.config file, Virtual Host File, DNS Config file and all sorts of other things are preventing this from working. I've fought that battle tons of times, getting them to understand is a waste of time - usually. So, the alternative file I posted above does not use cURL to produce the apps config.txt file when packaging apps. Future releases of the self hosted panel will use an entirely different approach anyway so none of this will matter after the next release. Homework: Go read the 500 page Apache Config Manual. Take a break, then read the 400 page cURL manual. Take another break. Read the 600 page Linux / PHP integration guide after lunch. When you're all done, fly to Host Gator and show them how they "could" setup their backends to make it easier on everyone and MORE secure :-)
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
03/06/13 01:16 AM (12 years ago)
David, thank you for great explanation, it will be great to have a time for Homework...:)
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
03/06/13 01:51 AM (12 years ago)
David, one more thing I download source code and open it in xCode and at home page (in simulator) when I click on refresh button I receive this error: "There was a problem parsing some configuration data. Please make sure that it is well-formed."
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/06/13 02:34 AM (12 years ago)
@nickrick32: Copy the config data, test it in the JSON validator tool at JSON lint (google it). Impossible to know what's wrong with the JSON without seeing it. You'll find the trouble easy using that validator tool. Clicking REFRESH has nothing to do with any plugins or any updates we just made. This is simply your phone hitting the dataURL setup in the project. Hit it with your browser, do you get valid JSON data?
 
nickrick32
Apple Fan
Profile
Posts: 111
Reg: Feb 28, 2011
location unknow...
1,110
like
03/06/13 02:40 AM (12 years ago)
@David I test downloaded config in JSON validator and it is valid - in self hosting control panel --> JSON data I have this <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <title>Index of /server/api/app</title> </head> <body> <h1>Index of /server/api/app</h1> <ul><li><a href="/server/api/"> Parent Directory</a></li> </ul> <address>Apache Server at www.domain.com Port 80</address> </body></html> and there is no configuration data
 

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.