Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Any error logging? #147

Open
rtorcato opened this issue Dec 3, 2013 · 32 comments
Open

Any error logging? #147

rtorcato opened this issue Dec 3, 2013 · 32 comments
Labels

Comments

@rtorcato
Copy link

rtorcato commented Dec 3, 2013

I have it installed on mamp and i see no errors in the error logs.

Genghis displays: FAIL An unexpected server error has occurred.

How can i get a more detailed reason for what went wrong.

@bobthecow
Copy link
Owner

Post a screenshot?

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

screen shot 2013-12-03 at 12 39 04 pm

@bobthecow
Copy link
Owner

Wow. I don't think I've ever actually seen that alert actually show up.

It's a fallback for a fallback error message:

try {
    data = JSON.parse(response.responseText);
} catch (e) {
    data = {error: response.responseText};
}
msg = data.error || '<strong>FAIL</strong> An unexpected server error has occurred.';

This means that not only did your server not return what Genghis was expecting, but it didn't return anything at all, so there's not a more helpful message for Genghis to display.

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

lol ok i will go and see what my server error level is

@bobthecow
Copy link
Owner

Do you mind checking in dev tools to see what URL it was requesting when it ran into that? That might help track it down as well.

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

what dev tools? There is no javascript errors.

my error level is set to: E_ALL & ~E_NOTICE

@bobthecow
Copy link
Owner

The "Timeline" or "Net" tab of Inspector, or Console, or Firebug, or whatever your browser has. Just check what URL was requested that didn't return 200 OK.

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

screen shot 2013-12-03 at 1 10 12 pm

@bobthecow
Copy link
Owner

It looks like you're using the 3.0 dev branch, right? Are you running genghis.php or genghis-dev.php?

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

yes i tried the dev branch to see if my error would go away

@bobthecow
Copy link
Owner

Never mind, I can tell from the screenshot you just posted. Are you using rewrite rules? Are you running this on its own virtual host, or in a folder?

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

most likely this issue is same as what i had before on my amazon lamp stack. using the new mongoclient http://derickrethans.nl/mongoclient.html

@bobthecow
Copy link
Owner

Genghis should support both with and without MongoClient.

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

it's just running in a folder. No change to rewrite .

@bobthecow
Copy link
Owner

https://github.com/bobthecow/genghis/tree/develop <- that is the dev branch.

https://github.com/bobthecow/genghis/tree/feature/three-dot-oh-my <- that is a very much work-in-progress 3.0 dev branch.

For now, you probably want the first one, not the second :)

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

ok grabbed the first link and updated htaccess file with no success.

@bobthecow
Copy link
Owner

One of the two URLs that's failing for you is check-status, an API call that does a couple of environment sanity checks. It doesn't do anything crazy at all, just check for Mongo drivers, timezone issues, magic quote config, etc:

https://github.com/bobthecow/genghis/blob/feature/three-dot-oh-my/src/php/Genghis/Api.php#L96-L171

So that shouldn't be MongoClient related.

@bobthecow
Copy link
Owner

If the other dev version didn't work for you, it's probably environment related. What version of MAMP are you running?

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

Version 2.0.5 (2.0.5)

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

php 5.3.6

@bobthecow
Copy link
Owner

Okay. Lemme see if I can reproduce it.

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

it might be easier to debug if you installed this with genghis http://filp.github.io/whoops/demo/

Laravel framework has whoops included.

if I went to http://localhost/genghis/check-status in my browser should that be displaying a 404 error or json response?

@bobthecow
Copy link
Owner

I love whoops :)

For the non-dev releases (i.e. the compiled genghis.php) it would be just about worthless though. Might make sense to include it in genghis-dev.php for 3.0+ though. I'll look into it.

@bobthecow
Copy link
Owner

/check-status would return 404 if you hit it in a browser.

Most Genghis paths respond to two kinds of requests: for standard browser requests, they respond with an HTML page. For XHR requests, they respond as a JSON API. For example, /servers/localhost is usually a page with a list of servers on it. But if you request it as XHR with Accept: application/json, it will return the JSON representation of that list of servers.

/check-status doesn't respond to the regular HTML request, however. It's one of the few endpoints that's XHR/JSON only. It wouldn't be a bad idea to make it a sort of debugging page though. I'll look into that for 3.0+ too :)

@bobthecow
Copy link
Owner

Okay. The good news is that I was able to reproduce this. The bad news is that I'm not exactly sure what it's doing :)

I'll keep looking.

@bobthecow
Copy link
Owner

You're sure you're not getting any errors in your MAMP logs? Mine is missing the Mongo class (I haven't installed the Mongo extension in MAMP yet) but the error shows up in logs/php_error.log

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

nope nothing in my error logs.

@bobthecow
Copy link
Owner

And you have the Mongo extension installed and working?

@rtorcato
Copy link
Author

rtorcato commented Dec 3, 2013

yep it works. I have it working with codeigniter and i also have mongo working with a laravel site I just started.

@bobthecow
Copy link
Owner

Just for fun, try out the latest version?

@rtorcato
Copy link
Author

sorry no change

@bobthecow
Copy link
Owner

Ok. I'll look into it further when I get a chance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants