razwanrazaq Posted February 6 Posted February 6 Hi, im trying to run a python script via cgi folder but getting a 500 error but the error logs dont show any information. All i can see in the error logs is below: [Thu Feb 06 21:51:25.494273 2025] [cgid:error] [pid 104352:tid 104376] [client 146.90.205.82:0] AH01215: stderr from /home/razwanrazaq.helioho.st/httpdocs/cgi-bin/tradingTheCloseTrades2.cgi: failed to open log file /var/log/httpd/suexec_log, referer: https://tommy.heliohost.org/ [Thu Feb 06 21:51:25.494339 2025] [cgid:error] [pid 104352:tid 104376] [client 146.90.205.82:0] AH01215: stderr from /home/razwanrazaq.helioho.st/httpdocs/cgi-bin/tradingTheCloseTrades2.cgi: fopen: Permission denied, referer: https://tommy.heliohost.org/ [Thu Feb 06 21:51:25.494569 2025] [cgid:error] [pid 104352:tid 104376] [client 146.90.205.82:0] End of script output before headers: tradingTheCloseTrades2.cgi, referer: https://tommy.heliohost.org/ [Thu Feb 06 21:51:42.818643 2025] [cgid:error] [pid 104149:tid 104193] [client 146.90.205.82:0] AH01215: stderr from /home/razwanrazaq.helioho.st/httpdocs/cgi-bin/tradingTheCloseTrades2.cgi: failed to open log file /var/log/httpd/suexec_log, referer: https://tommy.heliohost.org/ [Thu Feb 06 21:51:42.818721 2025] [cgid:error] [pid 104149:tid 104193] [client 146.90.205.82:0] AH01215: stderr from /home/razwanrazaq.helioho.st/httpdocs/cgi-bin/tradingTheCloseTrades2.cgi: fopen: Permission denied, referer: https://tommy.heliohost.org/ [Thu Feb 06 21:51:42.819101 2025] [cgid:error] [pid 104149:tid 104193] [client 146.90.205.82:0] End of script output before headers: tradingTheCloseTrades2.cgi, referer: https://tommy.heliohost.org/ Please can you advise. thanks Razwan Quote
Unknown025 Posted February 6 Posted February 6 It's likely a file permissions error, but an administrator can give you more information. I'll escalate your thread so one can weigh in. Quote
Krydos Posted February 7 Posted February 7 stderr from /home/razwanrazaq.helioho.st/httpdocs/cgi-bin/tradingTheCloseTrades2.cgi: fopen: Permission denied It's trying to open a file that it doesn't have permission to open, and failing. What file are you trying to open? Quote
razwanrazaq Posted February 7 Author Posted February 7 I didn't think it was opening any files but I will double check this Quote
razwanrazaq Posted February 7 Author Posted February 7 Hi I'm not opening any files in my code, is there a better way to see the errors? thanks Raz Quote
Krydos Posted February 7 Posted February 7 34 minutes ago, razwanrazaq said: is there a better way to see the errors? Here's our documentation for how to access the logs. https://wiki.helionet.org/View_Error_Logs But the fact that you posted the error log yourself means you already know how to view the error logs. 34 minutes ago, razwanrazaq said: I'm not opening any files in my code What is this then? # ======= LOAD CHECKED VIDEOS ======= def load_checked_videos(): if os.path.exists(CHECKED_VIDEOS_FILE): with open(CHECKED_VIDEOS_FILE, "r") as file: Do you even know what your code is doing? Quote
razwanrazaq Posted February 7 Author Posted February 7 Yes that is a function but is not being called from the main script Quote
Krydos Posted February 7 Posted February 7 The error message you posted was about that script. Which script are we debugging then? Quote
razwanrazaq Posted February 7 Author Posted February 7 So this script is correct and this function is within the script but I don't call this function in my code Quote
Krydos Posted February 7 Posted February 7 Your script had DOS line endings \r\n. Our servers run Linux (not Windows) so you need to use Linux line endings \n. Does it work now that I converted your line endings? Quote
razwanrazaq Posted February 11 Author Posted February 11 so yes, that has kind of worked but now i'm getting a different error. 2025-02-08 11:19:04 Error 146.90.205.82 504 GET /cgi-bin/tradingTheCloseTrades2.cgi HTTP/1.0 967 Apache SSL/TLS access 2025-02-08 11:20:04 Warning 146.90.205.82 AH01220: Timeout waiting for output from CGI script /home/razwanrazaq.helioho.st/httpdocs/cgi-bin/tradingTheCloseTrades2.cgi, referer: https://tommy.heliohost.org/ Apache error 2025-02-08 11:20:04 Error 146.90.205.82 Script timed out before returning headers: tradingTheCloseTrades2.cgi, referer: https://tommy.heliohost.org/ Apache error 2025-02-08 11:20:04 Error 146.90.205.82 3204009#0: *843175 upstream timed out (110: Connection timed out) while reading response header from upstream nginx error I created my own debug/log file and it gets a timeout on the below are there any restrictions on external urls/api's? 2025-02-11 09:23:44,238 - DEBUG - URL being requested: GET https://youtube.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=PL6iyqX0myJ2H-0gSt6qMmA5ztI1jdnRZV&maxResults=1&key=<removed>&alt=json Quote
razwanrazaq Posted February 11 Author Posted February 11 Also i have created a new file helioScript.cgi that i tried this with, the older file has some line ending/tab issues Quote
Krydos Posted February 11 Posted February 11 Have you tested this script on your local PC? How long does it take to complete on your home PC? Quote
razwanrazaq Posted February 11 Author Posted February 11 so takes around a minute in total, below are some bits of the local log where the server script fails: 2025-02-11 21:39:49,432 - INFO - Start of script 2025-02-11 21:39:49,432 - INFO - main script start 2025-02-11 21:39:49,441 - INFO - file_cache is only supported with oauth2client<4.0.0 2025-02-11 21:39:49,451 - DEBUG - URL being requested: GET https://youtube.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=PL6iyqX0myJ2H-0gSt6qMmA5ztI1jdnRZV&maxResults=1&key=AIzaSyDt7H2TpNiCYPwbTMnm_zHVovDnhjQX8PA&alt=json 2025-02-11 21:39:49,815 - INFO - got video 2025-02-11 21:39:49,815 - INFO - foud video 2025-02-11 21:39:49,819 - DEBUG - Starting new HTTPS connection (1): notegpt.io:443 Quote
Krydos Posted February 11 Posted February 11 I have increased your Apache and Nginx timeout from 30 seconds to 5 minutes. Does it work now? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.