[error] [client 178.59.111.223] (2)No such file or directory: execof

F

Ferrous Cranus

I think that something iam missing in the new VPS implementation
concerning my python web page.

After: tail -F /usr/local/apache/logs/error_log &

================
[Tue Aug 27 12:49:52 2013] [error] [client 178.59.111.223] (2)No such
file or directory: exec of '/home/nikos/public_html/cgi-bin/metrites.py'
failed
[Tue Aug 27 12:49:52 2013] [error] [client 178.59.111.223] Premature end
of script headers: metrites.py
================

I do not understand what this type of error is trying to say.
 
F

Ferrous Cranus

Στις 27/8/2013 3:52 μμ, ο/η Ferrous Cranus έγÏαψε:
I think that something iam missing in the new VPS implementation
concerning my python web page.

After: tail -F /usr/local/apache/logs/error_log &

================
[Tue Aug 27 12:49:52 2013] [error] [client 178.59.111.223] (2)No such
file or directory: exec of '/home/nikos/public_html/cgi-bin/metrites.py'
failed
[Tue Aug 27 12:49:52 2013] [error] [client 178.59.111.223] Premature end
of script headers: metrites.py
================

I do not understand what this type of error is trying to say.

Okey it was the python path (shebang that was causing this)

Now i have correct it from

/usr/local/bin/python3 => /usr/bin/python
System has beens etup this way to point directly to python 3.3.2 in the
new VPS.
Admin setit up that way hwile in the old one was different.

But i cannot overocme thjis:

[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Error in
sys.excepthook:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] ValueError:
underlying buffer has been detached
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Original
exception was:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Traceback
(most recent call last):
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File
"/home/nikos/public_html/cgi-bin/metrites.py", line 169, in <module>
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File
"/usr/local/bin/python/lib/python3.3/site-packages/pymysql/cursors.py",
line 108, in execute
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] query =
query % escaped_args
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] TypeError:
unsupported operand type(s) for %: 'bytes' and 'str'
 
F

Ferrous Cranus

Στις 27/8/2013 4:05 μμ, ο/η Ferrous Cranus έγÏαψε:
Στις 27/8/2013 3:52 μμ, ο/η Ferrous Cranus έγÏαψε:
I think that something iam missing in the new VPS implementation
concerning my python web page.

After: tail -F /usr/local/apache/logs/error_log &

================
[Tue Aug 27 12:49:52 2013] [error] [client 178.59.111.223] (2)No such
file or directory: exec of '/home/nikos/public_html/cgi-bin/metrites.py'
failed
[Tue Aug 27 12:49:52 2013] [error] [client 178.59.111.223] Premature end
of script headers: metrites.py
================

I do not understand what this type of error is trying to say.

Okey it was the python path (shebang that was causing this)

Now i have correct it from

/usr/local/bin/python3 => /usr/bin/python
System has beens etup this way to point directly to python 3.3.2 in the
new VPS.
Admin setit up that way hwile in the old one was different.

But i cannot overocme thjis:

[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Error in
sys.excepthook:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] ValueError:
underlying buffer has been detached
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Original
exception was:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Traceback
(most recent call last):
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File
"/home/nikos/public_html/cgi-bin/metrites.py", line 169, in <module>
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File
"/usr/local/bin/python/lib/python3.3/site-packages/pymysql/cursors.py",
line 108, in execute
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] query =
query % escaped_args
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] TypeError:
unsupported operand type(s) for %: 'bytes' and 'str'
someone please?
 
I

ishish

[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Error in
sys.excepthook:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
ValueError: underlying buffer has been detached
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Original
exception was:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Traceback
(most recent call last):
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File
"/home/nikos/public_html/cgi-bin/metrites.py", line 169, in <module>
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File

"/usr/local/bin/python/lib/python3.3/site-packages/pymysql/cursors.py",
line 108, in execute
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] query
= query % escaped_args
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
TypeError: unsupported operand type(s) for %: 'bytes' and 'str'

I quote from a Python 3 Guide
[http://python.about.com/od/python30/ss/30_strings_3.htm]:

The two data types, str and bytes, are mutually exclusive. One cannot
legally combine them into one call. With the distinction between text
and data, therefore, comes the need to convert between them.
 
F

Ferrous Cranus

Στις 27/8/2013 4:59 μμ, ο/η ishish έγÏαψε:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Error in
sys.excepthook:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
ValueError: underlying buffer has been detached
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Original
exception was:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Traceback
(most recent call last):
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File
"/home/nikos/public_html/cgi-bin/metrites.py", line 169, in <module>
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File

"/usr/local/bin/python/lib/python3.3/site-packages/pymysql/cursors.py",
line 108, in execute
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] query
= query % escaped_args
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
TypeError: unsupported operand type(s) for %: 'bytes' and 'str'

I quote from a Python 3 Guide
[http://python.about.com/od/python30/ss/30_strings_3.htm]:

The two data types, str and bytes, are mutually exclusive. One cannot
legally combine them into one call. With the distinction between text
and data, therefore, comes the need to convert between them.

So, in this line:

cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )

the variable 'page' needs conversion to what?

all that is stores is the location of a file

path = '/home/nikos/public_html/'

page = form.getvalue('page')

if not page and os.path.exists( file ):
# it is an html template
page = file.replace( path, '' )

So chnage it to what?
 
I

ishish

Am 27.08.2013 16:04, schrieb Ferrous Cranus:
Στις 27/8/2013 4:59 μμ, ο/η ishish έγÏαψε:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Error
in
sys.excepthook:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
ValueError: underlying buffer has been detached
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
Original
exception was:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
Traceback
(most recent call last):
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File
"/home/nikos/public_html/cgi-bin/metrites.py", line 169, in
<module>
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File


"/usr/local/bin/python/lib/python3.3/site-packages/pymysql/cursors.py",
line 108, in execute
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
query
= query % escaped_args
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
TypeError: unsupported operand type(s) for %: 'bytes' and 'str'

I quote from a Python 3 Guide
[http://python.about.com/od/python30/ss/30_strings_3.htm]:

The two data types, str and bytes, are mutually exclusive. One
cannot
legally combine them into one call. With the distinction between
text
and data, therefore, comes the need to convert between them.

So, in this line:

cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )

the variable 'page' needs conversion to what?

all that is stores is the location of a file

path = '/home/nikos/public_html/'

page = form.getvalue('page')

if not page and os.path.exists( file ):
# it is an html template
page = file.replace( path, '' )

So chnage it to what?


The error occurs in file
"/usr/local/bin/python/lib/python3.3/site-packages/pymysql/cursors.py",
line 108, in execute
query = query % escaped_args

You can check the actual values and data types using:

print repr(query)
print type(query)

print repr(escaped_args)
print type(escaped_args)

Always useful is a proper exception handling using try:/except:
 
S

Steven D'Aprano

So, in this line:

cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )

the variable 'page' needs conversion to what?

You tell us. You want to be a programmer, *you* need to do the
programming, and not just keep asking others to solve every single bug.
You have been given all the clues to solve this problem. Start by
checking what the type of 'page' is, then decide what it ought to be.

Hint: you can use

"print(type(page), file=open('path/to/some/file', 'w'))"

to see the type of the variable 'page' without displaying it on your
website.


all that is stores is the location of a file

path = '/home/nikos/public_html/'
page = form.getvalue('page')

And what result does form.getvalue return?

What is its type? Is it a list, a tuple, a dict, a bytes object, a float,
a str object, something else? DON'T GUESS, and don't assume, find out for
sure, by inspecting the result.

if not page and os.path.exists( file ):
# it is an html template
page = file.replace( path, '' )

So chnage it to what?

What do you think you need to change it to? Pick one:


1) bytes
2) an integer
3) a string
4) a list of floats
5) something else
 
D

Dennis Lee Bieber

someone please?
You waited only 30 minutes before bumping the thread?...

Consider that your time zone is 8 hours ahead of mine, your post came
in an hour after I went to work. The earliest I'd be likely to see your
post is an hour after getting home, or about 10 hours after your post.

As for the prior post complaint...

Was the older system running Python 2.x? Is the new one running Python
3.x? If so, read the documentation defining what has changed between 2.x
and 3.x.

Hint: strings in 3.x are UNICODE, while strings in 2.x are plain BYTES.

The database adapter may expect different data types.
 
F

Ferrous Cranus

Τη ΤÏίτη, 27 ΑυγοÏστου 2013 8:07:52 μ.μ. UTC+3, ο χÏήστης Steven D'Aprano έγÏαψε:
You tell us. You want to be a programmer, *you* need to do the

programming, and not just keep asking others to solve every single bug.

You have been given all the clues to solve this problem. Start by

checking what the type of 'page' is, then decide what it ought to be.



Hint: you can use



"print(type(page), file=open('path/to/some/file', 'w'))"



to see the type of the variable 'page' without displaying it on your

website.











And what result does form.getvalue return?



What is its type? Is it a list, a tuple, a dict, a bytes object, a float,

a str object, something else? DON'T GUESS, and don't assume, find out for

sure, by inspecting the result.










What do you think you need to change it to? Pick one:





1) bytes

2) an integer

3) a string

4) a list of floats

5) something else

Hello Steven,

i tried to do what you said and iam receing this:

[Wed Aug 28 08:43:31 2013] [error] [client 108.162.231.120] Original exception was:
[Wed Aug 28 08:43:31 2013] [error] [client 108.162.231.120] Traceback (mostrecent call last):
[Wed Aug 28 08:43:31 2013] [error] [client 108.162.231.120] File "/home/nikos/public_html/cgi-bin/metrites.py", line 39, in <module>
[Wed Aug 28 08:43:31 2013] [error] [client 108.162.231.120] print( type(page), file=open('../err.out', 'w') )
[Wed Aug 28 08:43:31 2013] [error] [client 108.162.231.120] PermissionError: [Errno 13] \\u0386\\u03c1\\u03bd\\u03b7\\u03c3\\u03b7 \\u03c0\\u03c1\\u03cc\\u03c3\\u03b2\\u03b1\\u03c3\\u03b7\\u03c2: '../err.out'
[Wed Aug 28 08:43:31 2013] [error] [client 108.162.231.120] Premature end of script headers: metrites.py



Also many times when i try to view the error_log by

tail -F /usr/local/apache/logs/error_log &

i get realtime scrolling of other joomla webistes pho errors and i have hard time trackign my own webistes erros.

is ther a work around for that?
 
F

Ferrous Cranus

In my attemtpt to be shwon only mesages pertaining to superhost.gr i try:

alias err='tail -F /usr/local/apache/logs/error_log | grep nikos &'

but now it only displays to me the lines that have '/home/nikos' within them and not all the relevant error lines.
 
F

Ferrous Cranus

Τη ΤÏίτη, 27 ΑυγοÏστου 2013 6:22:32 μ.μ. UTC+3, ο χÏήστης ishish έγÏαψε:
Am 27.08.2013 16:04, schrieb Ferrous Cranus:
Στις 27/8/2013 4:59 μμ, ο/η ishish έγÏαψε:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] Error
in
sys.excepthook:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
ValueError: underlying buffer has been detached
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
Original
exception was:
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
Traceback
(most recent call last):
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File
"/home/nikos/public_html/cgi-bin/metrites.py", line 169, in
<module>
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189] File


"/usr/local/bin/python/lib/python3.3/site-packages/pymysql/cursors.py",
line 108, in execute
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
query
= query % escaped_args
[Tue Aug 27 13:02:57 2013] [error] [client 110.202.175.189]
TypeError: unsupported operand type(s) for %: 'bytes' and 'str'

I quote from a Python 3 Guide
[http://python.about.com/od/python30/ss/30_strings_3.htm]:

The two data types, str and bytes, are mutually exclusive. One
cannot
legally combine them into one call. With the distinction between
text
and data, therefore, comes the need to convert between them.
So, in this line:
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
the variable 'page' needs conversion to what?
all that is stores is the location of a file
path = '/home/nikos/public_html/'
page = form.getvalue('page')
if not page and os.path.exists( file ):
# it is an html template
page = file.replace( path, '' )

So chnage it to what?

What is now proved was at first only imagined!





The error occurs in file

"/usr/local/bin/python/lib/python3.3/site-packages/pymysql/cursors.py",

line 108, in execute

query = query % escaped_args



You can check the actual values and data types using:



print repr(query)

print type(query)



print repr(escaped_args)

print type(escaped_args)



Always useful is a proper exception handling using try:/except:


hOW YOU MEAN PLEASE I TRY TO IMPLMENT WHAT YOU PROPOSE BUT I CANT.

try:
#find the needed counter for the page URL
if os.path.exists( path + page ) or os.path.exists( cgi_path + page ):
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
data = cur.fetchone() #URL is unique, so should only be one


print repr('''SELECT ID FROM counters WHERE url = %s''')
print type('''SELECT ID FROM counters WHERE url = %s''')

print repr(escaped_args)
print type(escaped_args)

I MEAN IF FAILS BEFORE IT TRIES TO GO INTO MY PRINT STAEMNT.
HOW AM I GONNA CPATURE THE QUERY?
 
I

ishish

Am 28.08.2013 10:48, schrieb Ferrous Cranus:
I quote from a Python 3 Guide

The two data types, str and bytes, are mutually exclusive. One

legally combine them into one call. With the distinction between

and data, therefore, comes the need to convert between them.
So, in this line:
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
the variable 'page' needs conversion to what?
all that is stores is the location of a file
path = '/home/nikos/public_html/'
page = form.getvalue('page')
if not page and os.path.exists( file ):
# it is an html template
page = file.replace( path, '' )

So chnage it to what?

What is now proved was at first only imagined!





The error occurs in file


"/usr/local/bin/python/lib/python3.3/site-packages/pymysql/cursors.py",

line 108, in execute

query = query % escaped_args



You can check the actual values and data types using:



print repr(query)

print type(query)



print repr(escaped_args)

print type(escaped_args)



Always useful is a proper exception handling using try:/except:


hOW YOU MEAN PLEASE I TRY TO IMPLMENT WHAT YOU PROPOSE BUT I CANT.

try:
#find the needed counter for the page URL
if os.path.exists( path + page ) or os.path.exists( cgi_path + page
):
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
data = cur.fetchone() #URL is unique, so should only be one


print repr('''SELECT ID FROM counters WHERE url = %s''')
print type('''SELECT ID FROM counters WHERE url = %s''')

print repr(escaped_args)
print type(escaped_args)

I MEAN IF FAILS BEFORE IT TRIES TO GO INTO MY PRINT STAEMNT.
HOW AM I GONNA CPATURE THE QUERY?


http://i.stack.imgur.com/jiFfM.jpg

http://wiki.python.org/moin/HandlingExceptions
 
F

Ferrous Cranus

Τη ΤετάÏτη, 28 ΑυγοÏστου 2013 1:11:05 μ.μ. UTC+3, ο χÏήστης ishish έγÏαψε:

is this how you mean?

try:
#find the needed counter for the page URL
if os.path.exists( path + page ) or os.path.exists( cgi_path + page ):
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
data = cur.fetchone() #URL is unique, so should only be one
except:
print repr(query)
print type(query)

print repr(escaped_args)
print type(escaped_args)


but i cannot see the error_log because of constant scrolling of error output.
 
F

Ferrous Cranus

Τη ΤετάÏτη, 28 ΑυγοÏστου 2013 1:43:08 μ.μ. UTC+3, ο χÏήστης Ferrous Cranus έγÏαψε:
Τη ΤετάÏτη, 28 ΑυγοÏστου 2013 1:11:05 μ.μ. UTC+3, ο χÏήστης ishish έγÏαψε:






is this how you mean?



try:

#find the needed counter for the page URL

if os.path.exists( path + page ) or os.path.exists( cgi_path + page ):

cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )

data = cur.fetchone() #URL is unique, so should only be one

except:

print repr(query)

print type(query)



print repr(escaped_args)

print type(escaped_args)





but i cannot see the error_log because of constant scrolling of error output.

i try: tail -F /usr/local/apache/logs/error_log | grep nikos &'

and see the follwing. if i dont grep at all i cannot stop the eroor output:

(e-mail address removed) [~]# [Wed Aug 28 10:44:22 2013] [error] [client 108.162.231.120] File "/home/nikos/public_html/cgi-bin/metrites.py", line 173, in <module>
[Wed Aug 28 10:44:22 2013] [error] [client 108.162.231.120] File "/home/nikos/public_html/cgi-bin/metrites.py", line 176, in <module>
[Wed Aug 28 10:44:22 2013] [error] [client 108.162.231.120] File does not exist: /home/nikos/public_html/500.shtml
 
F

Ferrous Cranus

Okey, continue trying and trying i came up with this:


try:
if os.path.exists( path + page ) or os.path.exists( cgi_path + page ):
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
data = cur.fetchone()
except:
with open("err.out", "a") as f:
f.write( repr(query), type(query) )
f.write( repr(escaped_args), type(escaped_args) )


But i cannot test it without looking at the error log which is scrolling like hell and doesn't even quit with a ctrl+c

How will i manage to troubleshoot?
Please confirm the above is correct and is what you were propsoing i shoudl test.
 
D

Dave Angel

But i cannot test it without looking at the error log which is scrolling like hell and doesn't even quit with a ctrl+c

I take it this 'error log" is shared with other users, and you can't
constrain them to cease and desist for a while?
How will i manage to troubleshoot?
Please confirm the above is correct and is what you were propsoing i shoudl test.

You really have no directory in which you have write permissions? If
so, perhaps you'd better solve that first.
 
F

Ferrous Cranus

Τη ΤετάÏτη, 28 ΑυγοÏστου 2013 2:32:44 μ.μ. UTC+3, ο χÏήστης Dave Angel έγÏαψε:
I take it this 'error log" is shared with other users, and you can't

constrain them to cease and desist for a while?








You really have no directory in which you have write permissions? If

so, perhaps you'd better solve that first.



[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] Error in sys.excepthook:
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] ValueError: underlying buffer has been detached
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120]
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] Original exception was:
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] Traceback (mostrecent call last):
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] File "/home/nikos/public_html/cgi-bin/metrites. py", line 173, in <module>
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] File "/usr/local/bin/python/lib/python3.3/site- packages/pymysql/cursors.py", line 108, in execute
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] query = query % escaped_args
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] TypeError: unsupported operand type(s) for %: 'by tes' and 'str'
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120]
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] During handlingof the above exception, another e xception occurred:
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120]
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] Traceback (mostrecent call last):
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] File "/home/nikos/public_html/cgi-bin/metrites. py", line 176, in <module>
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] with open("err.out", "a") as f:
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] PermissionError: [Errno 13] \\u0386\\u03c1\\u03bd \\u03b7\\u03c3\\u03b7 \\u03c0\\u03c1\\u03cc\\u03c3\\u03b2\\u03b1\\u03c3\\u03b7\\u03c2: 'err.out'
[Wed Aug 28 11:34:36 2013] [error] [client 108.162.231.120] File does not exist: /home/nikos/public_html/500. shtml
 
F

Ferrous Cranus

Τη ΤετάÏτη, 28 ΑυγοÏστου 2013 2:32:44 μ.μ. UTC+3, ο χÏήστης Dave Angel έγÏαψε:
I take it this 'error log" is shared with other users, and you can't

constrain them to cease and desist for a while?








You really have no directory in which you have write permissions? If

so, perhaps you'd better solve that first.


hello Dave,

no this is the general error log apache produces for all the server.

Is there a way to grep error logging info, pertainign only to my specific nikos account or my superhost.gr domain?
 
I

ishish

Am 28.08.2013 12:14, schrieb Ferrous Cranus:
Okey, continue trying and trying i came up with this:


try:
if os.path.exists( path + page ) or os.path.exists( cgi_path + page
):
cur.execute('''SELECT ID FROM counters WHERE url = %s''', page )
data = cur.fetchone()
except:
with open("err.out", "a") as f:
f.write( repr(query), type(query) )
f.write( repr(escaped_args), type(escaped_args) )


But i cannot test it without looking at the error log which is
scrolling like hell and doesn't even quit with a ctrl+c

How will i manage to troubleshoot?
Please confirm the above is correct and is what you were propsoing i
shoudl test.

A simple way I always use if it comes to exception handling:

import sys
import traceback

# Exception Identification
def formatExceptionInfo(maxTBlevel=5):
cla, exc, trbk = sys.exc_info()
excName = cla.__name__
try:
excArgs = exc.__dict__["args"]
except KeyError:
excArgs = "<no args>"
excTb = traceback.format_tb(trbk, maxTBlevel)
return (excName, excArgs, excTb)

try:
# Your code
except:
print formatExceptionInfo()
 
F

Ferrous Cranus

Τη ΤετάÏτη, 28 ΑυγοÏστου 2013 2:32:44 μ.μ. UTC+3, ο χÏήστης Dave Angel έγÏαψε:
I take it this 'error log" is shared with other users, and you can't

constrain them to cease and desist for a while?








You really have no directory in which you have write permissions? If

so, perhaps you'd better solve that first.


of cours ei ahve write permissions. Here:

(e-mail address removed) [~]# ls -ld www/
drwxr-x--- 4 nikos nobody 4096 Jul 13 10:33 www//
(e-mail address removed) [~]# ls -ld www/cgi-bin/
drwxr-xr-x 2 nikos nikos 4096 Aug 28 10:41 www/cgi-bin//


whick make it a mysterya s to why
with open("../err.out", "a") as f:

fails to write the file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top