Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #103029 > unrolled thread
| Started by | Φώντας Λαδοπρακόπουλος <nikos.gr33k@gmail.com> |
|---|---|
| First post | 2016-02-16 12:02 -0800 |
| Last post | 2016-02-18 06:45 -0800 |
| Articles | 5 — 3 participants |
Back to article view | Back to comp.lang.python
Weird and sparese cgi:error Φώντας Λαδοπρακόπουλος <nikos.gr33k@gmail.com> - 2016-02-16 12:02 -0800
Re: Weird and sparese cgi:error Jeremy Leonard <jrmy.lnrd@gmail.com> - 2016-02-17 05:47 -0800
Re: Weird and sparese cgi:error Chris Angelico <rosuav@gmail.com> - 2016-02-18 00:53 +1100
Re: Weird and sparese cgi:error Φώντας Λαδοπρακόπουλος <nikos.gr33k@gmail.com> - 2016-02-18 06:47 -0800
Re: Weird and sparese cgi:error Φώντας Λαδοπρακόπουλος <nikos.gr33k@gmail.com> - 2016-02-18 06:45 -0800
| From | Φώντας Λαδοπρακόπουλος <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2016-02-16 12:02 -0800 |
| Subject | Weird and sparese cgi:error |
| Message-ID | <813cd989-bc60-4d24-96ef-f20244d91362@googlegroups.com> |
Hello, I recentely changed VPS server and when i try to load my webiste iam receiving 500 error which i wasnt receiving in my old VPS server with the same exact cgi scripts. After looking at Apacher's error_log iam seeing the following output when i try to load scripts from cgi-bin directory. [Tue Feb 16 21:28:55.970302 2016] [cgi:error] [pid 17478] [client 180.76.15.28:21311] End of script output before headers: metrites.py [Tue Feb 16 21:29:31.193281 2016] [cgi:error] [pid 18802] [client 180.76.15.29:34155] End of script output before headers: metrites.py [Tue Feb 16 21:32:21.306627 2016] [cgi:error] [pid 17478] [client 188.138.124.110:40212] End of script output before headers: metrites.py [Tue Feb 16 21:37:21.128472 2016] [cgi:error] [pid 19731] [client 204.152.200.42:54376] End of script output before headers: metrites.py [Tue Feb 16 21:42:21.198207 2016] [cgi:error] [pid 17478] [client 184.75.210.226:57252] End of script output before headers: metrites.py [Tue Feb 16 21:47:21.228361 2016] [cgi:error] [pid 19731] [client 76.72.172.208:34730] End of script output before headers: metrites.py [Tue Feb 16 21:52:21.422066 2016] [cgi:error] [pid 18802] [client 85.17.156.11:52071] End of script output before headers: metrites.py Please i need your assistance to this. thank you.Prob
[toc] | [next] | [standalone]
| From | Jeremy Leonard <jrmy.lnrd@gmail.com> |
|---|---|
| Date | 2016-02-17 05:47 -0800 |
| Message-ID | <a0be3911-299e-4647-abca-3ed1f7acd453@googlegroups.com> |
| In reply to | #103029 |
On Tuesday, February 16, 2016 at 3:02:40 PM UTC-5, Φώντας Λαδοπρακόπουλος wrote: > Hello, > > I recentely changed VPS server and when i try to load my webiste iam receiving 500 error which i wasnt receiving in my old VPS server with the same exact cgi scripts. > > After looking at Apacher's error_log iam seeing the following output when i try to load scripts from cgi-bin directory. > > > [Tue Feb 16 21:28:55.970302 2016] [cgi:error] [pid 17478] [client 180.76.15.28:21311] End of script output before headers: metrites.py > [Tue Feb 16 21:29:31.193281 2016] [cgi:error] [pid 18802] [client 180.76.15.29:34155] End of script output before headers: metrites.py > [Tue Feb 16 21:32:21.306627 2016] [cgi:error] [pid 17478] [client 188.138.124.110:40212] End of script output before headers: metrites.py > [Tue Feb 16 21:37:21.128472 2016] [cgi:error] [pid 19731] [client 204.152.200.42:54376] End of script output before headers: metrites.py > [Tue Feb 16 21:42:21.198207 2016] [cgi:error] [pid 17478] [client 184.75.210.226:57252] End of script output before headers: metrites.py > [Tue Feb 16 21:47:21.228361 2016] [cgi:error] [pid 19731] [client 76.72.172.208:34730] End of script output before headers: metrites.py > [Tue Feb 16 21:52:21.422066 2016] [cgi:error] [pid 18802] [client 85.17.156.11:52071] End of script output before headers: metrites.py > > > Please i need your assistance to this. > thank you.Prob If you import the cgitb module and then put cgitb.enable() in the first line of your code this can help give you more descriptive error messages on the page that is producing the errors
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2016-02-18 00:53 +1100 |
| Message-ID | <mailman.208.1455717207.22075.python-list@python.org> |
| In reply to | #103051 |
On Thu, Feb 18, 2016 at 12:47 AM, Jeremy Leonard <jrmy.lnrd@gmail.com> wrote: > On Tuesday, February 16, 2016 at 3:02:40 PM UTC-5, Φώντας Λαδοπρακόπουλος wrote: >> Hello, >> >> I recentely changed VPS server and when i try to load my webiste iam receiving 500 error which i wasnt receiving in my old VPS server with the same exact cgi scripts. >> >> After looking at Apacher's error_log iam seeing the following output when i try to load scripts from cgi-bin directory. >> >> >> [Tue Feb 16 21:28:55.970302 2016] [cgi:error] [pid 17478] [client 180.76.15.28:21311] End of script output before headers: metrites.py >> [Tue Feb 16 21:29:31.193281 2016] [cgi:error] [pid 18802] [client 180.76.15.29:34155] End of script output before headers: metrites.py >> [Tue Feb 16 21:32:21.306627 2016] [cgi:error] [pid 17478] [client 188.138.124.110:40212] End of script output before headers: metrites.py >> [Tue Feb 16 21:37:21.128472 2016] [cgi:error] [pid 19731] [client 204.152.200.42:54376] End of script output before headers: metrites.py >> [Tue Feb 16 21:42:21.198207 2016] [cgi:error] [pid 17478] [client 184.75.210.226:57252] End of script output before headers: metrites.py >> [Tue Feb 16 21:47:21.228361 2016] [cgi:error] [pid 19731] [client 76.72.172.208:34730] End of script output before headers: metrites.py >> [Tue Feb 16 21:52:21.422066 2016] [cgi:error] [pid 18802] [client 85.17.156.11:52071] End of script output before headers: metrites.py >> >> >> Please i need your assistance to this. >> thank you.Prob > > If you import the cgitb module and then put cgitb.enable() in the first line of your code this can help give you more descriptive error messages on the page that is producing the errors > And if that doesn't work, I'd look at the very beginning of code execution - can the Python interpreter even be found? What happens if you run one of the scripts from a shell? Maybe there's a shebang problem. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Φώντας Λαδοπρακόπουλος <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2016-02-18 06:47 -0800 |
| Message-ID | <5a3b0097-0be2-4f30-974d-1ee02a1d81d2@googlegroups.com> |
| In reply to | #103052 |
[root@nexus cgi-bin]# head -10 ./metrites.py
#!/usr/bin/python3
# coding=utf-8
import cgitb; cgitb.enable()
import cgi, re, os, sys, socket, time, datetime, locale, codecs, random, smtplib, subprocess, pymysql, geoip2.database
from datetime import datetime, timedelta
from http import cookies
#needed line, script does *not* work without it
[root@nexus cgi-bin]# ^C
[root@nexus cgi-bin]# /usr/bin/python3
Python 3.3.2 (default, Aug 14 2014, 14:25:52)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
KeyboardInterrupt
>>>
KeyboardInterrupt
>>> quit()
[root@nexus cgi-bin]#
[root@nexus cgi-bin]# /usr/bin/python3 ./metrites.py
Error in sys.excepthook:
ValueError: underlying buffer has been detached
Original exception was:
Traceback (most recent call last):
File "/opt/rh/python33/root/usr/lib64/python3.3/os.py", line 673, in __getitem__
value = self._data[self.encodekey(key)]
KeyError: b'HTTP_USER_AGENT'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./metrites.py", line 22, in <module>
userinfo = os.environ['HTTP_USER_AGENT']
File "/opt/rh/python33/root/usr/lib64/python3.3/os.py", line 676, in __getitem__
raise KeyError(key)
KeyError: 'HTTP_USER_AGENT'
[root@nexus cgi-bin]# ^C
[toc] | [prev] | [next] | [standalone]
| From | Φώντας Λαδοπρακόπουλος <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2016-02-18 06:45 -0800 |
| Message-ID | <00242dad-3be0-41cb-b15f-ef31d32f23b8@googlegroups.com> |
| In reply to | #103051 |
#!/usr/bin/python3
# coding=utf-8
import cgitb; cgitb.enable()
import cgi, re, os, sys, socket, time, datetime, locale, codecs, random, smtplib, subprocess, pymysql, geoip2.database
from datetime import datetime, timedelta
from http import cookies
===================
[root@nexus cgi-bin]# /usr/bin/python3
Python 3.3.2 (default, Aug 14 2014, 14:25:52)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
=============================
[root@nexus cgi-bin]# /usr/bin/python3 ./metrites.py
Error in sys.excepthook:
ValueError: underlying buffer has been detached
Original exception was:
Traceback (most recent call last):
File "/opt/rh/python33/root/usr/lib64/python3.3/os.py", line 673, in __getitem__
value = self._data[self.encodekey(key)]
KeyError: b'HTTP_USER_AGENT'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./metrites.py", line 22, in <module>
userinfo = os.environ['HTTP_USER_AGENT']
File "/opt/rh/python33/root/usr/lib64/python3.3/os.py", line 676, in __getitem__
raise KeyError(key)
KeyError: 'HTTP_USER_AGENT'
[root@nexus cgi-bin]#
=======================================
everything is they should but still iam gettign that weird cgi:err error
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web