How to debug Server Error 500 on Openshift, when rhc tail does not show errors? - openshift

I'm trying to debug a Server Error 500 with my application. I've read that you should use rhc tail to show a live log stream and with the current error, the log stream that appears when trying to display the page is:
==> app-root/logs/python.log <==
79.24.253.62 - - [01/Jan/2015:08:32:17 -0500] "GET /url/ HTTP/1.1" 500 27 "http://a-b.rhcloud.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"
The error shown is:
Other pages work, this error only appears on certain "more advanced" pages (eg. static pages show correctly). The rest of the log, is:
==> app-root/logs/python.log <==
[Thu Jan 01 08:30:43 2015] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:openshift_t:s0:c6,c654
[Thu Jan 01 08:30:43 2015] [notice] Digest: generating secret for digest authentication ...
[Thu Jan 01 08:30:43 2015] [notice] Digest: done
[Thu Jan 01 08:30:43 2015] [notice] Apache/2.2.15 (Unix) mod_wsgi/3.4 Python/3.3.2 configured -- resuming normal operations
and:
==> app-root/logs/postgresql.log <==
2015-01-01 13:30:25 GMT LOG: shutting down
2015-01-01 13:30:25 GMT LOG: database system is shut down
2015-01-01 13:30:31 GMT LOG: could not bind socket for statistics collector: Permission denied
2015-01-01 13:30:31 GMT LOG: trying another address for the statistics collector
2015-01-01 13:30:31 GMT LOG: could not bind socket for statistics collector: Cannot assign requested address
2015-01-01 13:30:31 GMT LOG: disabling statistics collector for lack of working socket
2015-01-01 13:30:31 GMT WARNING: autovacuum not started because of misconfiguration
2015-01-01 13:30:31 GMT HINT: Enable the "track_counts" option.
2015-01-01 13:30:31 GMT LOG: database system was shut down at 2015-01-01 13:30:25 GMT
2015-01-01 13:30:31 GMT LOG: database system is ready to accept connections
What is the next step to debug this problem?

I added the following Django logging configuration which gave me the details of the 500 errors in a file django.log. I set LOG_DIR = os.environ.get('OPENSHIFT_LOG_DIR')
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'WARNING',
'class': 'logging.FileHandler',
'filename': os.path.join(LOG_DIR, 'django.log'),
},
},
'loggers': {
'django.request': {
'handlers': ['file'],
'level': 'WARNING',
'propagate': True,
},
},
}

Related

XAMPP: mysql shuts down every day or two, Needs to restart xampp every time

Everything was working fine, but now I get error in browser while visiting my websites "error establishing database connection". Error gets solved after restarting xampp, and what I observe every time that mysql module of xampp stops running.
Few months ago this error was coming every 15 days, and I always solved this issue by restarting xampp, but now it occurs very frequently(everyday or in 2 days).
I also tried one solution "deleting the file ibdata1" that helped me for 3-4 days, and problem started again.
here is my error log:
[Mon Dec 05 14:36:21.001921 2016] [ssl:warn] [pid 7479] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Dec 05 14:36:21.001985 2016] [ssl:warn] [pid 7479] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Dec 05 14:36:21.002084 2016] [suexec:notice] [pid 7479] AH01232: suEXEC mechanism enabled (wrapper: /opt/lampp/bin/suexec)
[Mon Dec 05 14:36:21.050579 2016] [auth_digest:notice] [pid 7480] AH01757: generating secret for digest authentication ...
[Mon Dec 05 14:36:22.001567 2016] [ssl:warn] [pid 7480] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Dec 05 14:36:22.001605 2016] [ssl:warn] [pid 7480] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Dec 05 14:36:22.001713 2016] [lbmethod_heartbeat:notice] [pid 7480] AH02282: No slotmem from mod_heartmonitor
[Mon Dec 05 14:36:22.019204 2016] [mpm_prefork:notice] [pid 7480] AH00163: Apache/2.4.10 (Unix) OpenSSL/1.0.1i PHP/5.5.15 mod_perl/2.0.8-dev Perl/v5.16.3 configured -- resuming normal operations
[Mon Dec 05 14:36:22.019244 2016] [core:notice] [pid 7480] AH00094: Command line: '/opt/lampp/bin/httpd -E /opt/lampp/logs/error_log -D SSL -D PHP'
[Tue Dec 06 05:25:35.571290 2016] [mpm_prefork:notice] [pid 7480] AH00169: caught SIGTERM, shutting down
It is big problem to me as well as visitors of my websites.
Please guys, If any one of you know how to solve this issue, do reply.
Thanks in advance !!
I got the same error on my website.
In my case it was the cron upgrade proces which gave an MySQL error. After fixing this no restarts where needed anymore.

shows blank page after deploying a grails war file on openshift

i deployed a war file to openshift after creating a tomcat 7(JBoss EWS 2.0) app using the following guide lines (deploy war file using git)
but after deploying my app it only shows a blank page. here are the logs i got by using the rhc tail command.
==> app-root/logs/jbossews.log <==
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1571)
at net.sf.ehcache.util.concurrent.ConcurrentHashMap$ValuesView.iterator(
ConcurrentHashMap.java:3252)
at net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl$1.run(Exten
dedStatisticsImpl.java:104)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
1)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:745)
==> app-root/logs/mysql.log <==
160420 10:20:46 InnoDB: highest supported file format is Barracuda.
160420 10:20:46 InnoDB: Waiting for the background threads to start
160420 10:20:47 InnoDB: 5.5.45 started; log sequence number 1595675
160420 10:20:47 [Note] Server hostname (bind-address): '127.9.179.2'; port: 3306
160420 10:20:47 [Note] - '127.9.179.2' resolves to '127.9.179.2';
160420 10:20:47 [Note] Server socket created on IP: '127.9.179.2'.
160420 10:20:47 [Warning] 'proxies_priv' entry '# root#ex-std-node563.prod.rhclo
ud.com' ignored in --skip-name-resolve mode.
160420 10:20:47 [Note] Event Scheduler: Loaded 0 events
160420 10:20:47 [Note] /opt/rh/mysql55/root/usr/libexec/mysqld: ready for connec
tions.
Version: '5.5.45' socket: '/var/lib/openshift/571649900c1e669c5c00017c/mysql//s
ocket/mysql.sock' port: 3306 MySQL Community Server (GPL)
==> app-root/logs/phpmyadmin.log <==
[Tue Apr 19 11:24:41 2016] [notice] Apache/2.2.15 (Unix) PHP/5.3.3 configured --
resuming normal operations
[Tue Apr 19 12:27:32 2016] [notice] SIGHUP received. Attempting to restart
[Tue Apr 19 12:27:32 2016] [notice] Digest: generating secret for digest authent
ication ...
[Tue Apr 19 12:27:32 2016] [notice] Digest: done
[Tue Apr 19 12:27:32 2016] [notice] Apache/2.2.15 (Unix) PHP/5.3.3 configured --
resuming normal operations
[Wed Apr 20 10:20:38 2016] [notice] caught SIGWINCH, shutting down gracefully
[Wed Apr 20 10:21:05 2016] [notice] SELinux policy enabled; httpd running as con
text unconfined_u:system_r:openshift_t:s0:c4,c884
[Wed Apr 20 10:21:05 2016] [notice] Digest: generating secret for digest authent
ication ...
[Wed Apr 20 10:21:05 2016] [notice] Digest: done
[Wed Apr 20 10:21:05 2016] [notice] Apache/2.2.15 (Unix) PHP/5.3.3 configured --
resuming normal operations
the name of the war file i deployed is ROOT.war using git push and it deployed successfully.i am using mysql database and phpmyadmin cartridges.
i just want to figure out why it is showing me a blank page when i try to access the url of my application.
thanks in advance.
The log you provided is not helpfull at all, because it's not full, I even can't see what exception was thrown.
This is the best article about deploying grails application on OpenShift, it will help you a lot:
Grails on Openshift
Also the troubleshoutting will be more productive if you use ftp to see what's going on on your server
Using FileZilla and SFTP on Windows with OpenShift
i have fixed the problem with the help i got from #Taras Kohut. i added the following lines to my BuildConfig.groovy file.
grails.project.war.exploded.dir = "/yourLocalPathToClonedOpenshiftFile/webapps/ROOT"
grails.war.exploded=true
the above lines will generate an exploded war file in your openshift app in the webapps folder.
next i added ROOT.war.deploy file again in the webapps directory.This is a file which instructs jboss that after the push it must take the ROOT folder and deploy it on Tomcat (which is emulated by JBoss) as if it was a war file.
after that i committed and pushed my changes and the app is deployed successfully and everything works fine.

Cygnus can not persist data on Cosmos global instance

When trying to persist an entity from Cygnus to Cosmos global instance it fails.
Looking at the log file I see something like that:
2015 15:31:50,006 DEBUG [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.http.impl.conn.DefaultClientConnection.sendRequestHeader:273) - >> GET /webhdfs/v1/user/ms/def_serv/def_servpath/6_registervalues/6_registervalues.txt?op=getfilestatus&user.name=ms HTTP/1.1
12 Nov 2015 15:31:50,006 DEBUG [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.http.impl.conn.DefaultClientConnection.sendRequestHeader:276) - >> X-Auth-Token: xxxxxxxxxxxxxxxxxxx
12 Nov 2015 15:31:50,006 DEBUG [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.http.impl.conn.DefaultClientConnection.sendRequestHeader:276) - >> Host: cosmos.lab.fiware.org:14000
12 Nov 2015 15:31:50,006 DEBUG [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.http.impl.conn.DefaultClientConnection.sendRequestHeader:276) - >> Connection: Keep-Alive
12 Nov 2015 15:31:50,007 DEBUG [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.http.impl.conn.DefaultClientConnection.sendRequestHeader:276) - >> User-Agent: Apache-HttpClient/4.2.1 (java 1.5)
12 Nov 2015 15:31:50,284 DEBUG [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.http.impl.conn.DefaultClientConnection.close:169) - Connection 0.0.0.0:59834<->130.206.80.46:14000 closed
12 Nov 2015 15:31:50,285 DEBUG [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.http.impl.client.DefaultRequestDirector.tryExecute:716) - Closing the connection.
12 Nov 2015 15:31:50,285 DEBUG [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.http.impl.conn.DefaultClientConnection.close:169) - Connection 0.0.0.0:59834<->130.206.80.46:14000 closed
12 Nov 2015 15:31:50,286 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.http.impl.client.DefaultRequestDirector.tryExecute:723) - I/O exception (java.net.SocketException) caught when processing request: Connection reset
12 Nov 2015 15:31:50,287 DEBUG [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.http.impl.client.DefaultRequestDirector.tryExecute:728) - Connection reset
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:185)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
(I have obfuscated the token in the example above.)
for some reason the connection is closed.
Orion and Cygnus are installed on a fiware lab private instance in Spain2.
When trying to fire the same request from the command line from the Orion machine, I get the same disconnected response.
curl -X GET "http://cosmos.lab.fiware.org:14000/webhdfs/v1/user/ms/def_serv/def_servpath/6_registervalues/6_registervalues.txt?op=getfilestatus&user.name=ms" -H "X-Auth-Token: xxxxxxxxxxxxxxxxxxxxxx"
curl: (56) Failure when receiving data from the peer
But surprisingly, when doing the same request from the command line from the Cosmos global instance, it works!
See:
[ms#cosmosmaster-gi ~]$ curl -X GET "http://cosmos.lab.fiware.org:14000/webhdfs/v1/user/ms/def_serv/def_servpath/6_registervalues/6_registervalues.txt?op=getfilestatus&user.name=ms" -H "X-Auth-Token: xxxxxxxxxxxxxxxxx"
{"FileStatus":{"pathSuffix":"","type":"FILE","length":2,"owner":"ms","group":"ms","permission":"644","accessTime":1447332222908,"modificationTime":1447253745711,"blockSize":67108864,"replication":3}}
[ms#cosmosmaster-gi ~]$
Seems like Cosmos will not service connection arriving from a fiware lab instance running on Spain2.
Does anyone knows what's the issue here, and how to correct this.
Thanks!
Menachem S.
Issue was solved by a workaround.
The Cygnus server was installed on an external node ( a Machine on Azure), and everything works fine wrt Orion-->Cygnus-->Cosmos stream.

error running apache after xampp install

I installed xampp on win7 and get this error when starting apache.
I unchecked skype and nothing changes.
How do I find what is using port 80? How do I fix this please.
I dont have another server running.
update this is the error. I click on start and get this problem
Error: Apache shutdown unexpectedly.
11:27:19 PM [Apache] This may be due to a blocked port, missing dependencies,
11:27:19 PM [Apache] improper privileges, a crash, or a shutdown by another method.
11:27:19 PM [Apache] Press the Logs button to view error logs and check
11:27:19 PM [Apache] the Windows Event Viewer for more clues
11:27:19 PM [Apache] If you need more help, copy and post this
11:27:19 PM [Apache] entire log window on the forums
The below link didnt help me
Why won't Apache start in XAMPP installation?
Here is the error log
[Sat Jun 07 22:36:53.823331 2014] [ssl:warn] [pid 6048:tid 236] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 07 22:36:54.084345 2014] [ssl:warn] [pid 6048:tid 236] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 07 22:36:55.240412 2014] [mpm_winnt:notice] [pid 6048:tid 236] AH00455: Apache/2.4.9 (Win32) OpenSSL/1.0.1g PHP/5.5.11 configured -- resuming normal operations
[Sat Jun 07 22:36:55.241412 2014] [mpm_winnt:notice] [pid 6048:tid 236] AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:13:13
[Sat Jun 07 22:36:55.241412 2014] [core:notice] [pid 6048:tid 236] AH00094: Command line: 'E:\\xampp\\apache\\bin\\httpd.exe -d E:/xampp/apache'
[Sat Jun 07 22:36:55.339417 2014] [mpm_winnt:notice] [pid 6048:tid 236] AH00418: Parent: Created child process 1840
[Sat Jun 07 22:36:55.950452 2014] [ssl:warn] [pid 1840:tid 248] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 07 22:36:56.202467 2014] [ssl:warn] [pid 1840:tid 248] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 07 22:36:56.299472 2014] [mpm_winnt:notice] [pid 1840:tid 248] AH00354: Child: Starting 150 worker threads.
Try those methods, it should work:
quit/exit Skype (make sure it's not running) because it reserves localhost:80
disable Anti-virus (Try first to disable skype and running again, if it didn't work do this step)
Right click on xampp control panel and run as administrator
I had the same problem, I solved changing the ports.
-> Clicked button Config front of Apache.
1) Select Apache (httpd.conf)
2) searched for this line: Listen 80
3) changed for this: Listen 8081
4) saved file
-> Click Config button front of Apache.
1) Select Apache (httpd-ssl.conf)
2) searched for this line: Listen 443
3) changed for this: Listen 444
4) saved file
I can run xammp from port 8081
http://localhost:8081/
You have to give port number you gave to enter the localhost
Hope this helps you to understand what is happening.
I got the same error when xampp was installed on windows 10.
www.example.com:443:0 server certificate does NOT include an
ID which matches the server name
So I opened httpd-ssl.conf file in xampp folder and changed the following line
ServerName www.example.com:443
To
ServerName localhost
And the problem was fixed.
I think killing the process which is uses that port is more easy to handle than changing the ports in config files. Here is how to do it in Windows. You can follow same procedure to Linux but different commands.
Run command prompt as Administrator. Then type below command to find out all of processes using the port.
netstat -ano
There will be plenty of processes using various ports. So to get only port we need use findstr like below (here I use port 80)
netstat -ano | findstr 80
this will gave you result like this
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 7964
Last number is the process ID of the process. so what we have to do is kill the process using PID we can use taskkill command for that.
taskkill /PID 7964 /F
Run your server again. This time it will be able to run. This can uses for Mysql server too.
www.example.com:443:0 server certificate does NOT include an ID which matches the server name
I was getting this error when trying to start Apache, there is no error with Apache. It's an dependency error on windows 8 - probably the same for 7. Just right click and run as Admin :)
If you're still getting an error check your Antivirus/Firewall is not blocking Xampp or port 443.
After changing main port from 80 to 8080 you have to change the config in XAMPP control panel as I show in the images:
1)
2)
3)
Then restart the service and that's it !

Delay after RCTP command on GMail

I want to create a SMTP validation on registration at my website, but I got a strange behavior on GMail SMTP servers.
The validation looks like sending emails: after establishing connection with SMTP server I send commands EHLO, HELO, MAIL FROM, RCPT TO and QUIT.
Commands like HELO and MAIL FROM not take many time, but command RCPT TO can take about 3 seconds on GMail. For example, on several others servers this command takes only 200-300ms.
Also, if I check an existing email address, RCTP command takes only 600-900ms, but this delay always takes more then 3 seconds for unexisting address.
I think, this delay is an antispam behavior, but how I can bypass it?
My domain already has correct TXT-SPF and SPF records. My server not listed in any spam lists.
I'm not seeing the delay that you're reporting after RCPT TO. I run a mail server that logs the transcript with the remote MTA for every delivery. Looking at a few recent deliveries to gmail addresses, I see that the server for gmail responded with a 250 OK almost immediately after RCPT TO from my side. See below. (email addresses and IP's anonymized to protect the innocent!).
Tue Jul 23 16:01:52 2013 GMT DNS MX record lookup for gmail.com:
Tue Jul 23 16:01:52 2013 GMT MX1=gmail-smtp-in.l.google.com, MX2=alt1.gmail-smtp-in.l.google.com, MX3=alt2.gmail-smtp-in.l.google.com
Tue Jul 23 16:01:52 2013 GMT Attempting SMTP connection from smtp.myserver.com [x.x.x.x] to gmail-smtp-in.l.google.com [173.194.64.27] on port 25
Tue Jul 23 16:01:52 2013 GMT Delivery id 813435, process id 21352
Tue Jul 23 16:01:52 2013 GMT received from remotehost: 220 mx.google.com ESMTP b5si18818338obh.145 - gsmtp
Tue Jul 23 16:01:52 2013 GMT smtp.myserver.com sent: EHLO smtp.myserver.com
Tue Jul 23 16:01:52 2013 GMT received from remotehost: 250-mx.google.com at your service, [x.x.x.x]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250 PIPELINING
Tue Jul 23 16:01:52 2013 GMT smtp.myserver.com sent: STARTTLS
Tue Jul 23 16:01:52 2013 GMT received from remotehost: 220 2.0.0 Ready to start TLS
Tue Jul 23 16:01:52 2013 GMT starting TLS...
Tue Jul 23 16:01:52 2013 GMT TLS Enabled.
Tue Jul 23 16:01:52 2013 GMT smtp.myserver.com sent: EHLO smtp.myserver.com
Tue Jul 23 16:01:52 2013 GMT received from remotehost: 250-mx.google.com at your service, [x.x.x.x]
250-SIZE 35882577
250-8BITMIME
250-ENHANCEDSTATUSCODES
250 PIPELINING
Tue Jul 23 16:01:52 2013 GMT smtp.myserver.com sent: MAIL FROM: <sender#sender.com>
Tue Jul 23 16:01:52 2013 GMT received from remotehost: 250 2.1.0 OK b5si18818338obh.145 - gsmtp
Tue Jul 23 16:01:52 2013 GMT smtp.myserver.com sent: RCPT TO: <recipient#gmail.com>
Tue Jul 23 16:01:52 2013 GMT received from remotehost: 250 2.1.5 OK b5si18818338obh.145 - gsmtp
Tue Jul 23 16:01:52 2013 GMT smtp.myserver.com sent: DATA
Tue Jul 23 16:01:52 2013 GMT received from remotehost: 354 Go ahead b5si18818338obh.145 - gsmtp
Tue Jul 23 16:01:52 2013 GMT [sending message...] (14871 bytes)
Tue Jul 23 16:01:52 2013 GMT [message sent]
Tue Jul 23 16:01:53 2013 GMT received from remotehost: 250 2.0.0 OK 1374595312 b5si18818338obh.145 - gsmtp