where is the LOG file (vista?)

18 views
Skip to first unread message

stace

unread,
Dec 22, 2009, 1:44:03 PM12/22/09
to AppRocket
For some reason, I get the kinds or entities replicated in the mysql
DB, but no actual data. I can see when I run daemon.ply that some
error flashes at the end but it closes too fast to see. How the heck
can I access the log file?

thanks for the 2.0 update, I've actually had a lot of success with the
earlier version and I'm sure these enhancements will be great.

stace

unread,
Dec 22, 2009, 2:30:56 PM12/22/09
to AppRocket
I added some code to the end of deamon.py so it would show the error
instead of closing
raw_input('Press ENTER to continue...\n')

Now I can see the approcket error -
AttributeError: addinfour1 instance has no attribute 'code'


stace

unread,
Dec 22, 2009, 3:38:09 PM12/22/09
to AppRocket
ah sorry, I'm obviously no Python coder - that's addinfourl :)

Waleed Abdulla

unread,
Dec 22, 2009, 4:56:20 PM12/22/09
to appr...@googlegroups.com
I'm guessing you're using the latest version from the SVN, right? It didn't work for me either, until I fixed a couple of bugs. You didn't provide enough details, but here is the issue I encountered and the fix I used. Maybe it'll help you as well.

The problem for me was in the send_row method in station.py. This is the original code:


    def send_row(self, kind, key, entity, attempt):
        url = "%s/%s?secret_key=%s" % (ROCKET_URL, kind, SECRET_KEY)
        
        if self.after_send:
            url += "&after_send=%s" % self.after_send
            
        try:
            result = urllib.urlopen(url, urllib.urlencode(entity))
            response = ''.join(result).strip(" \r\n")
        except:
            logging.exception(self.name + ' Send %s: key=%s, attempt #%d failed' % (kind, key, attempt + 1))
            return False
        
        try:
            if result.code != 200:
                logging.error(self.name + " Send %s: key=%s, attempt #%d failed, code=%d, URL=%s, response=%s" % (kind, key, attempt, result.code, url, response))
                return False                    
        finally:
            result.close()
            
        return True
    


And here is my updated code. Make sure to add ( import urllib2 ) at the top of the page:



    def send_row(self, kind, key, entity, attempt):
        
        url = "%s/%s?secret_key=%s" % (ROCKET_URL, kind, SECRET_KEY)
        
        if self.after_send:
            url += "&after_send=%s" % self.after_send

        result = None
        try:
            result = urllib2.urlopen(url, urllib.urlencode(entity))
            response = ''.join(result).strip(" \r\n")
        except urllib2.HTTPError, e:
            error = self.name + " Send %s: key=%s, attempt #%d failed, code=%d, URL=%s, response=%s" % (kind, key, attempt, e.code, url, e.read())
            logging.error(error)
            return False
        except:
            error = self.name + ' Send %s: key=%s, attempt #%d failed' % (kind, key, attempt + 1)
            logging.exception(error)
            return False
        finally:
            if result: result.close()
            
        return True




stace

unread,
Dec 22, 2009, 5:51:41 PM12/22/09
to AppRocket
Hello Waleed - thanks for your speedy reply, very generous of you :)
I'll try this now - sorry about the error message not having enough
detail; could not cut and paste from the cmd window so I just added
what seemed the key point. I'll try this and post the full error if it
doesn't solve it.

Ah and yes I'm using the latest from SVN :)

stace

unread,
Dec 22, 2009, 6:23:14 PM12/22/09
to AppRocket
These changes need to be in your local version and your appspot (gae)
version, right? Will try again as I tried changing only the local
station.py and got errors again - cannot see them though as my Python
pause no longer works and I don't know where to find the log file.

stace

unread,
Dec 22, 2009, 7:13:39 PM12/22/09
to AppRocket
those errors were actually causes by incorrect line breaks from when I
tried pasting your code, should have looked closer :)

but nothing is getting written to mysql, even though I'm no longer
seeing errors. I'll look through the discussions and see if applying
other code fixes you've provided can help.

Waleed Abdulla

unread,
Dec 22, 2009, 7:25:26 PM12/22/09
to appr...@googlegroups.com
Glad that fixed one of your bugs. I never used App Rocket to receive data from app engine to mysql, though. So I haven't tried that code path. I hope someone else on this list can help. One other thing you can try is to use the latest stable version rather than the SVN version, as the svn version seems to be in development mode. 

By the way, the path to the log file should be in your config file. Although, I seem to remember that there was an issue with that which I posted about on the list earlier. 





--

You received this message because you are subscribed to the Google Groups "AppRocket" group.
To post to this group, send email to appr...@googlegroups.com.
To unsubscribe from this group, send email to approcket+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/approcket?hl=en.



stace

unread,
Dec 22, 2009, 7:54:56 PM12/22/09
to AppRocket
yes the path is /var/log/approcket.log - but that has little meaning
on Windows, and I don't have a /var folder anywhere in my version of
mysql.

Seems the log will be the only way to troubleshoot this app though -
I'll probably just keep using version 1.0 as it works to send and
receive flawlessly for me.

thanks again for your kind help - I'll also try using the stable
version and not the dev. trunks.*

Kaspars

unread,
Dec 23, 2009, 5:58:26 AM12/23/09
to AppRocket
DAEMON_LOG setting is only for background mode (-b command-line
switch), but I believe this is only supported on Linux.

On Windows everything is written to console, so you should just run
daemon.py from command prompt.

Kaspars

unread,
Dec 23, 2009, 5:55:17 AM12/23/09
to AppRocket
try deleting content of rocket_station table in MySQL and rerun
daemon.py
Reply all
Reply to author
Forward
0 new messages