Openshift site shuts down unexpectedly - openshift

I have a site hosted on OpenShift. Every so often, maybe once every two weeks, the server appears to randomly shut down the site. I get a 503 error on the page and the server log says:
DEBUG: Sending SIGTERM to child...
Thu Aug 06 2015 11:27:21 GMT-0400 (EDT): Received SIGTERM - terminating sample app ...
Thu Aug 06 2015 11:27:21 GMT-0400 (EDT): Node server stopped.
==> app-root/logs/mongodb.log <==
Thu Aug 6 11:27:19.208 [signalProcessingThread] shutdown: going to close sockets...
Thu Aug 6 11:27:19.208 [signalProcessingThread] shutdown: waiting for fs preallocator...
Thu Aug 6 11:27:19.208 [signalProcessingThread] shutdown: lock for final commit...
Thu Aug 6 11:27:19.208 [signalProcessingThread] shutdown: final commit...
Thu Aug 6 11:27:19.212 [signalProcessingThread] shutdown: closing all files...
Thu Aug 6 11:27:19.213 [signalProcessingThread] closeAllFiles() finished
Thu Aug 6 11:27:19.215 [signalProcessingThread] journalCleanup...
Thu Aug 6 11:27:19.215 [signalProcessingThread] removeJournalFiles
Thu Aug 6 11:27:19.269 [signalProcessingThread] shutdown: removing fs lock...
Thu Aug 6 11:27:19.314 dbexit: really exiting now
I can restart the app and it works fine again for a while but I would prefer to find the source of the issue and solve it. The error doesn't mean much to me. Where should I start looking for the origin of the SIGTERM?

Related

SSH service broken after sshd_config was modified

I modified the sshd_config but the ssh service became unavailable. How do I reset the config?
Here is the log:
Jul 29 14:10:03 bye sshd[578]: /etc/ssh/sshd_config line 6: Badly formatted port number.
Jul 29 14:10:03 bye systemd[1]: ssh.service: main process exited, code=exited, status=255/n/a
Jul 29 14:10:03 bye systemd[1]: Unit ssh.service entered failed state.
Jul 29 14:10:04 bye systemd[1]: ssh.service holdoff time over, scheduling restart.
Jul 29 14:10:04 bye systemd[1]: Stopping OpenBSD Secure Shell server...
Jul 29 14:10:04 bye systemd[1]: Starting Google Compute Engine VM initialization...
Jul 29 14:10:04 bye systemd[1]: Started Google Compute Engine VM initialization.
Jul 29 14:10:04 bye systemd[1]: Starting OpenBSD Secure Shell server...
Jul 29 14:10:04 bye systemd[1]: Started OpenBSD Secure Shell server.
Jul 29 14:10:04 bye sshd[582]: /etc/ssh/sshd_config line 6: Badly formatted port number.
Jul 29 14:10:04 bye systemd[1]: ssh.service: main process exited, code=exited, status=255/n/a
Jul 29 14:10:04 bye systemd[1]: Unit ssh.service entered failed state.
Jul 29 14:10:04 bye systemd[1]: ssh.service holdoff time over, scheduling restart.
Since you don't have access to your instance and you need to modify the sshd_config file you can either:
Delete the instance keeping the boot disk, attach it to another instance as secondary, modify the sshd_config file, detach the disk and then create a new instance using that disk.
Or you can modify the sshd_config file using the following startup-script:
#!/bin/bash
/bin/sed -i.bak 's/^Port .*/Port 22/g' /etc/ssh/sshd_config
This startup-script will modify the line that starts with "Port" to "Port 22". Also it will create a backup at /etc/ssh/sshd_config.bak.
After updating the instance metadata with the startup-script you need to reboot the instance because startup-scripts are executed when the instances boot up. Once you gain access to the instance, remove the script in order to avoid executing it to no avail.
I hope it helps.

loading * no listener in gwan linux 32-bit

GWAN error on Centos 7 version
I tried both version 64 bit and 32 bit version , I am using latest version from GWAN site.
Any help would be appreciated.
[Fri Nov 21 18:02:32 2014 GMT] user: root (uid:0), group: root (uid:0)
[Fri Nov 21 18:02:32 2014 GMT] system fd_max: 110,032
[Fri Nov 21 18:02:32 2014 GMT] program fd_max: 110,032
[Fri Nov 21 18:02:32 2014 GMT] updated fd_max: 500,000
[Fri Nov 21 18:02:32 2014 GMT] Available network interfaces (2):
[Fri Nov 21 18:02:32 2014 GMT] 127.0.0.1
[Fri Nov 21 18:02:32 2014 GMT] 10.21.150.98
[Fri Nov 21 18:02:32 2014 GMT] * no listener in /opt/gwan_linux32-bit
[Fri Nov 21 18:17:57 2014 GMT] ------------------------------------------------
[Fri Nov 21 18:17:57 2014 GMT] G-WAN 4.3.14 32-bit (Mar 14 2013 07:34:53)
[Fri Nov 21 18:17:57 2014 GMT] ------------------------------------------------
[Fri Nov 21 18:17:57 2014 GMT] Local Time: Fri, 21 Nov 2014 13:17:57 GMT-5
[Fri Nov 21 18:17:57 2014 GMT] RAM: (1.11 GiB free + 0 shared + 0 buffers) / 3.53 GiB total
[Fri Nov 21 18:17:57 2014 GMT] Physical Pages: 1.11 GiB / 3.53 GiB
[Fri Nov 21 18:17:57 2014 GMT] DISK: 19.14 GiB free / 19.55 GiB total
The problem is described in your log file:
no listener in /opt/gwan_linux32-bit
This is likely to be a file permission issue. Also, try to rename this folder as gwan32 as old versions had trouble with names matching the naming patterns used by listeners.
Note: the version you are using is quite old: G-WAN 4.3.14 (March 14 2013), registered users have access to far more recent releases that add features and patches for system (OS versions, LIBC versions, Hypervisors...) incompatibilities.

opennebula libvirt live migration failire

From the sunstone GUI I tried performing a live migration from luther to blackout but the migration failed. Kindly see below excerpt from oned.log. Thanks for assistance and leads in advance.
Wed Feb 12 13:15:34 2014 [VMM][I]: Successfully execute transfer manager driver operation: tm_premigrate.
Wed Feb 12 13:15:34 2014 [VMM][I]: ExitCode: 0
Wed Feb 12 13:15:34 2014 [VMM][I]: Successfully execute network driver operation: pre.
Wed Feb 12 13:15:35 2014 [VMM][I]: Command execution fail: /var/tmp/one/vmm/kvm/migrate 'one-4' 'blackout' 'luther' 4 luther
Wed Feb 12 13:15:35 2014 [VMM][E]: migrate: Command "virsh --connect qemu:///system migrate --live one-4 qemu+ssh://blackout/system" failed: error: unable to connect to server at 'blackout:49152': No route to host
Wed Feb 12 13:15:35 2014 [VMM][E]: Could not migrate one-4 to blackout
Wed Feb 12 13:15:35 2014 [VMM][I]: ExitCode: 1
Wed Feb 12 13:15:35 2014 [VMM][I]: Failed to execute virtualization driver operation: migrate.
Wed Feb 12 13:15:35 2014 [VMM][E]: Error live migrating VM: Could not migrate one-4 to blackout
Wed Feb 12 13:15:35 2014 [LCM][I]: Fail to live migrate VM. Assuming that the VM is still RUNNING (will poll VM).
Wed Feb 12 13:56:36 2014 [LCM][I]: New VM state is SAVE_STOP
Wed Feb 12 13:56:44 2014 [VMM][I]: ExitCode: 0
iptables was the culprit. Simple turn of iptables or add libvirt default port ranges

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

time for hg log --date

I generate hg logs for some repositories (on the remote server where all local repos push their changes to) using this command:
hg log -R "path-to-repo" -b somebranch --date "$YESTERDAY to $TODAY"
where :
YESTERDAY=$(date +%Y-%m-%d -d "yesterday")
TODAY=$(date +%Y-%m-%d)
As an example this could be:
hg log -R "path-to-repo" -b somebranch --date "2012-11-27 to 2012-11-28"
But at what time: hour:minutes:seconds does the generated log start when specifying --date? End would be the time when the command is executed.
The reason I ask is that the log was empty when I ran the above at 10:00 but when I ran it 11:10 it found changes.
You forgot about local timezone: date without TZ for mercurial is some predefined timezone (probably GMT)
BTW, "from yesterday" (without TZ-related headache) for hg log is static line --date "-1"
Example of log, when committer isn't from my local TZ
hg log --date "2012-11-04" --template "{date|date}\n"
Sat Nov 03 22:36:13 2012 -0400
Sat Nov 03 22:22:43 2012 -0400
Sat Nov 03 19:25:13 2012 -0400
Sat Nov 03 19:20:52 2012 -0400
Sat Nov 03 19:20:39 2012 -0400
Sat Nov 03 19:14:17 2012 -0400
Sat Nov 03 19:12:08 2012 -0400
Sat Nov 03 19:11:50 2012 -0400