"notify" is not getting called in Keepalived - haproxy

I have these setting in the keepalived.conf file but when I stop the HAProxy service it's not executing the notify script but when I restart the keepalived service it's getting executed every time. Here are the details,
HAProxy: 1.8.8
Keepalived: 2.0.18
OS: Ubuntu 18.04
Python: 2.7
Cloud Service Provider: Hetzner
/etc/keepalived/keepalived.conf
vrrp_script chk_haproxy {
# Requires keepalived-1.1.13
script "/usr/bin/pkill -0 haproxy" # cheaper than pidof
interval 2 # check every 2 seconds
weight 2 # add 2 points of priority if OK
}
vrrp_instance real {
interface eth0
state MASTER
virtual_router_id 51
priority 101 # 101 on primary, 100 on secondary
virtual_ipaddress {
11.23.10.19/32 dev eth0 label eth0:1
}
track_script {
chk_haproxy
}
notify "/etc/keepalived/master.sh"
#notify_backup "/etc/keepalived/master.sh"
#notify_fault "/etc/keepalived/master.sh"
}
/etc/keepalived/master.sh
#!/bin/bash
export API_TOKEN='<api_token>'
export MASTER_SERVER_ID='<master_server_id>'
export BACKUP_SERVER_ID='<backup_server_id>'
BASE_API='https://api.hetzner.cloud/v1'
FLOATING_IP_ID='<floating_ip_id>'
INSTANCE="Load-Balancer-Master"
if [ "$HOSTNAME" = "$INSTANCE" ]; then
SERVER_ID=$BACKUP_SERVER_ID # switch to the backup server if
# master gets down
else
SERVER_ID=$MASTER_SERVER_ID # vice-versa
fi
echo "Server ID: " $SERVER_ID
HAS_FLOATING_IP=$(curl -H "Authorization: Bearer $API_TOKEN" -s 'https://api.hetzner.cloud/v1/servers/'$SERVER_ID|python -c "import sys,json; print( True if json.load(sys.stdin)['server']['public_net']['floating_ips'] else False)")
echo "Has Floating Ip: " $HAS_FLOATING_IP
if [ $HAS_FLOATING_IP = "False" ]; then
n=0
while [ $n -lt 10 ]
do
python /usr/local/bin/assign-ip $FLOATING_IP_ID $SERVER_ID && break
n=$((n+1))
sleep 3
done
fi
/usr/local/bin/assign-ip
#!/usr/bin/python
import os
import sys
import requests
import json
api_base = 'https://api.hetzner.cloud/v1'
def usage():
print('{0} [Floating IP] [Server ID]'.format(sys.argv[0]))
print('\nYour Hetzner API token must be in the "API_TOKEN"'
' environmental variable.')
def main(floating_ip_id, server_id):
payload = {'server': server_id}
headers = {'Authorization': 'Bearer {0}'.format(os.environ['API_TOKEN']),
'Content-type': 'application/json'}
url = api_base + "/floating_ips/{0}/actions/assign".format(floating_ip_id)
r = requests.post(url, headers=headers, data=json.dumps(payload))
resp = r.json()
if resp['action']['error']:
print('{0}: {1}'.format(resp['action']['command'], resp['error']['message']))
sys.exit(1)
else:
print('Moving IP address to server: {0} with status:{1}'.format(server_id, resp['action']['status']))
if __name__ == "__main__":
if 'API_TOKEN' not in os.environ or not len(sys.argv) > 2:
usage()
sys.exit()
main(sys.argv[1], sys.argv[2])
When I stop the HAProxy server using sudo service haproxy stop and check the status I get this response,
● haproxy.service - HAProxy Load Balancer
Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2019-09-28 22:12:57 IST; 1s ago
Docs: man:haproxy(1)
file:/usr/share/doc/haproxy/configuration.txt.gz
Process: 26434 ExecStart=/usr/sbin/haproxy -Ws -f $CONFIG -p $PIDFILE $EXTRAOPTS (code=exited, stat
Process: 26423 ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS (code=exited, status=0/SU
Main PID: 26434 (code=exited, status=143)
Sep 28 00:44:18 Load-Balancer-Master haproxy[26434]: Proxy nginx_pool started.
Sep 28 00:44:18 Load-Balancer-Master haproxy[26434]: Proxy nginx_pool started.
Sep 28 00:44:18 Load-Balancer-Master systemd[1]: Started HAProxy Load Balancer.
Sep 28 22:12:57 Load-Balancer-Master haproxy[26434]: [WARNING] 270/004418 (26434) : Exiting Master pr
Sep 28 22:12:57 Load-Balancer-Master haproxy[26434]: [ALERT] 270/004418 (26434) : Current worker 2643
Sep 28 22:12:57 Load-Balancer-Master haproxy[26434]: [WARNING] 270/004418 (26434) : All workers exite
Sep 28 22:12:57 Load-Balancer-Master systemd[1]: Stopping HAProxy Load Balancer...
Sep 28 22:12:57 Load-Balancer-Master systemd[1]: haproxy.service: Main process exited, code=exited, s
Sep 28 22:12:57 Load-Balancer-Master systemd[1]: haproxy.service: Failed with result 'exit-code'.
Sep 28 22:12:57 Load-Balancer-Master systemd[1]: Stopped HAProxy Load Balancer.
and in the /var/log/syslog I get this,
Sep 28 18:35:41 Load-Balancer-Master systemd[1]: Started Session 114 of user driveu.
Sep 28 18:42:57 Load-Balancer-Master systemd[1]: Stopping HAProxy Load Balancer...
Sep 28 18:42:57 Load-Balancer-Master systemd[1]: haproxy.service: Main process exited, code=exited, status=143/n/a
Sep 28 18:42:57 Load-Balancer-Master systemd[1]: haproxy.service: Failed with result 'exit-code'.
Sep 28 18:42:57 Load-Balancer-Master systemd[1]: Stopped HAProxy Load Balancer.
Sep 28 18:42:57 Load-Balancer-Master Keepalived_vrrp[26884]: Script `chk_haproxy` now returning 1
Sep 28 18:42:57 Load-Balancer-Master Keepalived_vrrp[26884]: VRRP_Script(chk_haproxy) failed (exited with status 1)
Sep 28 18:42:57 Load-Balancer-Master Keepalived_vrrp[26884]: (real) Changing effective priority from 103 to 101
But the notify script does not get called and the floating ip does not get assigned to the BACKUP instance. As I am really new to Keepalived could anyone please help me to fix this issue?
Update: I have solved this problem
The interface should be the private network and have to specify the private ips of the MASTER and the BACKUP using unicast_src_ip and unicast_peer. The Modified setting is here,
vrrp_script chk_haproxy {
# Requires keepalived-1.1.13
script "/usr/bin/pkill -0 haproxy" # cheaper than pidof
interval 2 # check every 2 seconds
weight 2 # add 2 points of priority if OK
}
vrrp_instance real {
interface ens10 # changed it from eth0
state MASTER
virtual_router_id 51
priority 101 # 101 on primary, 100 on secondary
unicast_src_ip 192.168.0.3
unicast_peer {
192.168.0.2
}
authentication {
auth_type PASS
auth_pass password
}
virtual_ipaddress {
11.23.10.19/32 dev eth0 label eth0:1
}
track_script {
chk_haproxy
}
notify "/etc/keepalived/master.sh"
#notify_backup "/etc/keepalived/master.sh"
#notify_fault "/etc/keepalived/master.sh"
}

Related

Why logrotate doesn't properly postrotate only has 1 day delay

I have in /etc/logrotate.d/mikrotik :
/var/log/mikrotik.log {
rotate 2
daily
compress
dateext
dateyesterday
dateformat .%Y-%m-%d
postrotate
#/usr/sbin/invoke-rc.d syslog-ng reload >/dev/null
rsync -avH /var/log/mikrotik*.gz /backup/logs/mikrotik/
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
The mikrotik.log.YYYY-MM-DD.gz file is created daily
The problem is that rsync in postrotate doesn't copy the last file. For example, on September 25, 2021, there are such files in /var/log:
-rw-r ----- 1 root adm 37837 Sep 24 23:49 mikrotik.log. 2021-09-24.gz
-rw-r ----- 1 root adm 36980 Sep 25 23:55 mikrotik.log. 2021-09-25.gz
and in /backup/logs/mikrotik/ are only:
-rw-r ----- 1 root adm 35495 Sep 23 00:00 mikrotik.log. 2021-09-22.gz
-rw-r ----- 1 root adm 36842 Sep 23 23:58 mikrotik.log. 2021-09-23.gz
-rw-r ----- 1 root adm 37837 Sep 24 23:49 mikrotik.log. 2021-09-24.gz
There is no file mikrotik.log.2021-09-25.gz from Sep 25 23:55 it will not be copied until the next rotation.
How to make a file packed today copied by postrotate ?
Problem solved.
It relied on the order in which the operations were performed.
Lgrotate does a 'postrotate' section before compressing to .gz.
The solution to the problem was to change the name from 'postrotate' to 'lastaction'.

GoCD in Kubernetes(minikube) in Windows 10, container error CrashLoopBackOff, exit code: 111

I install GoCD using helm in Kubernetes and found that pod status is CrashLoopBackOff. I am using minikube with hyper-v in Windows 10 Pro. What's the problem? How can I find error root? Where can I find definition for exit code 111?
Here's my kubectl describe pod info:
Name: gocd-app-server-7fd8f8b48d-r6sn9
Namespace: gocd
Priority: 0
PriorityClassName: <none>
Node: minikube/192.168.88.82
Start Time: Thu, 21 Feb 2019 15:57:15 +0700
Labels: app=gocd
component=server
pod-template-hash=7fd8f8b48d
release=gocd-app
Annotations: <none>
Status: Running
IP: 172.17.0.16
Controlled By: ReplicaSet/gocd-app-server-7fd8f8b48d
Containers:
gocd-server:
Container ID: docker://907271ebbe383b533ef1eb892021eaabc4cf6264a7052e2e453fcf97fdb28de7
Image: gocd/gocd-server:v19.1.0
Image ID: docker-pullable://gocd/gocd-server#sha256:34204533eb0e0c6f7544c6aa29f2da815d972bd22124b32307ca4ca8f40abd61
Ports: 8153/TCP, 8154/TCP
Host Ports: 0/TCP, 0/TCP
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: Error
Exit Code: 111
Started: Fri, 22 Feb 2019 09:55:42 +0700
Finished: Fri, 22 Feb 2019 09:55:43 +0700
Ready: False
Restart Count: 4
Liveness: http-get http://:8153/go/api/v1/health delay=90s timeout=1s period=15s #success=1 #failure=10
Readiness: http-get http://:8153/go/api/v1/health delay=90s timeout=1s period=15s #success=1 #failure=10
Environment:
GOCD_PLUGIN_INSTALL_kubernetes-elastic-agents: https://github.com/gocd/kubernetes-elastic-agents/releases/download/2.1.0-123/kubernetes-elastic-agent-2.1.0-123.jar
GOCD_PLUGIN_INSTALL_docker-registry-artifact-plugin: https://github.com/gocd/docker-registry-artifact-plugin/releases/download/1.0.0-25/docker-registry-artifact-plugin-1.0.0-25.jar
Mounts:
/docker-entrypoint.d from goserver-vol (rw)
/godata from goserver-vol (rw)
/home/go from goserver-vol (rw)
/preconfigure_server.sh from config-vol (rw)
/var/run/secrets/kubernetes.io/serviceaccount from gocd-app-token-kbdjx (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
config-vol:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: gocd-app
Optional: false
goserver-vol:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: gocd-app-server
ReadOnly: false
gocd-app-token-kbdjx:
Type: Secret (a volume populated by a Secret)
SecretName: gocd-app-token-kbdjx
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events: <none>
I also checked nodes condition using kubectl describe nodes, here's the result
Conditions:
Type Status LastHeartbeatTime LastTransitionTime Reason Message
---- ------ ----------------- ------------------ ------ -------
MemoryPressure False Fri, 22 Feb 2019 10:25:48 +0700 Thu, 14 Feb 2019 18:16:55 +0700 KubeletHasSufficientMemory kubelet has sufficient memory available
DiskPressure False Fri, 22 Feb 2019 10:25:48 +0700 Thu, 14 Feb 2019 18:16:55 +0700 KubeletHasNoDiskPressure kubelet has no disk pressure
PIDPressure False Fri, 22 Feb 2019 10:25:48 +0700 Thu, 14 Feb 2019 18:16:55 +0700 KubeletHasSufficientPID kubelet has sufficient PID available
Ready True Fri, 22 Feb 2019 10:25:48 +0700 Thu, 21 Feb 2019 13:22:10 +0700 KubeletReady kubelet is posting ready status
Nodes condition seems to be alright.
Thank you for your assistance.
Try to check preconfigure logs while pods still running:
kubectl -n gocd exec -it gocd-app-server-68bf7759b9-9dmr5 -c gocd-server cat /godata/logs/preconfigure.log
kubectl -n gocd exec -it gocd-app-server-68bf7759b9-9dmr5 -c gocd-server cat /godata/logs/preconfigure_complete.log
I had some error in end, different code but, it could helps to find your issue:
checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
HTTP/1.1 200 OK
Date: Sat, 09 Mar 2019 14:59:05 GMT
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-UA-Compatible: chrome=1
Set-Cookie: JSESSIONID=node01oiy3yzw700oc1kq79gazxg27m1.node0;Path=/go;Expires=Sat, 23-Mar-2019 14:59:05 GMT;Max-Age=1209600;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: max-age=0, private, must-revalidate
Content-Type: application/vnd.go.cd.v1+json;charset=utf-8
ETag: "f710a37eb9543dcd53aa78be26c62ae6"
X-Runtime: 1248
Vary: Accept-Encoding, User-Agent
Transfer-Encoding: chunked
{
"_links" : {
"self" : {
"href" : "http://localhost:8153/go/api/elastic/profiles/demo-app"
},
"doc" : {
"href" : "https://api.gocd.org/19.2.0/#elastic-agent-profiles"
},
"find" : {
"href" : "http://localhost:8153/go/api/elastic/profiles/:profile_id"
}
},
"id" : "demo-app",
"plugin_id" : "cd.go.contrib.elasticagent.kubernetes",
"properties" : [ {
"key" : "Image",
"value" : "gocd/gocd-agent-docker-dind:v19.2.0"
}, {
"key" : "PodConfiguration",
"value" : "apiVersion: v1\nkind: Pod\nmetadata:\n name: pod-name-prefix-{{ POD_POSTFIX }}\n labels:\n app: web\nspec:\n serviceAccountName: default\n containers:\n - name: gocd-agent-container-{{ CONTAINER_POSTFIX }}\n image: gocd/gocd-agent-docker-dind:v19.2.0\n securityContext:\n privileged: true"
}, {
"key" : "SpecifiedUsingPodConfiguration",
"value" : "true"
}, {
"key" : "Privileged",
"value" : "true"
} ]
}Trying to configure plugin settings.
HTTP/1.1 100 Continue
checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
/ # command terminated with exit code 137
also there some other logs files which could help you to define it:
/ # ls -l /godata/logs/
total 212
-rw-r--r-- 1 go go 0 Mar 9 14:53 go-server-perf.log
-rw-r--r-- 1 go go 105813 Mar 9 15:10 go-server.log
-rw-r--r-- 1 go go 0 Mar 9 14:53 go-shine.log
-rw-r--r-- 1 go go 26788 Mar 9 15:09 plugin-cd.go.artifact.docker.registry.log
-rw-r--r-- 1 go go 1482 Mar 9 15:09 plugin-cd.go.authentication.ldap.log
-rw-r--r-- 1 go go 1626 Mar 9 15:09 plugin-cd.go.authentication.passwordfile.log
-rw-r--r-- 1 go go 58970 Mar 9 15:09 plugin-cd.go.contrib.elasticagent.kubernetes.log
in my case there were error in plugin-cd.go.contrib.elasticagent.kubernetes.log
But also you can disable preconfigure in values.yaml
server:
shouldPreconfigure: false
and redeploy it with
helm delete --purge gocd-app
helm install stable/gocd --name gocd-app --namespace gocd -f path/to/values.yaml
values.yaml for chart you can get there https://raw.githubusercontent.com/helm/charts/master/stable/gocd/values.yaml

Touchscreen on Raspberry Pi emits click not touch

i folowed this link to calibrate touchscreen: http://www.circuitbasics.com/raspberry-pi-touchscreen-calibration-screen-rotation/.
ls -la /dev/input/
total 0
drwxr-xr-x 4 root root 240 Jul 12 18:38 .
drwxr-xr-x 15 root root 3460 Jul 12 18:38 ..
drwxr-xr-x 2 root root 140 Jul 12 18:38 by-id
drwxr-xr-x 2 root root 140 Jul 12 18:38 by-path
crw-rw---- 1 root input 13, 64 Jul 12 18:38 event0
crw-rw---- 1 root input 13, 65 Jul 12 18:38 event1
crw-rw---- 1 root input 13, 66 Jul 12 18:38 event2
crw-rw---- 1 root input 13, 67 Jul 12 18:38 event3
crw-rw---- 1 root input 13, 68 Jul 12 18:38 event4
crw-rw---- 1 root input 13, 63 Jul 12 18:38 mice
crw-rw---- 1 root input 13, 32 Jul 12 18:38 mouse0
crw-rw---- 1 root input 13, 33 Jul 12 18:38 mouse1
root#raspberrypi:/sys/devices/virtual/input# cat input4/uevent
PRODUCT=0/0/0/0
NAME="FT5406 memory based driver"
PROP=2
EV=b
KEY=400 0 0 0 0 0 0 0 0 0 0
ABS=2608000 3
MODALIAS=input:b0000v0000p0000e0000-e0,1,3,k14A,ra0,1,2F,35,36,39,mlsfw
root#raspberrypi:~# cat /etc/ts.conf
# Uncomment if you wish to use the linux input layer event interface
module_raw input
# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d
# module_raw collie
# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860
# module_raw corgi
# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface
# module_raw ucb1x00
# Uncomment if you're using an HP iPaq h3600 or similar
# module_raw h3600
# Uncomment if you're using a Hitachi Webpad
# module_raw mk712
# Uncomment if you're using an IBM Arctic II
# module_raw arctic2
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear
I only get response when configuring X with xinput_calibrator. When i enter this command
sudo TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/event1 ts_calibrate
I get optput
xres = 800, yres = 480
selected device is not a touchscreen I understand
Can someone please help me,
Thanks in advance.
I don't have a solution for this, but I believe that it is related to the problem of touches being treated as mouseovers. This bug has been reported several times, but never actually fixed
https://gitlab.gnome.org/GNOME/gtk/-/issues/945
https://bugzilla.gnome.org/show_bug.cgi?id=789041
https://bugs.launchpad.net/ubuntu-mate/+bug/1792787
A bugzilla.gnome.org user named niteshgupta16 created a script that solves this problem, but it was uploaded to pasting/sharing service called hastebin at https://www.hastebin.com/uwuviteyeb.py.
Hastebin deletes files that have not been accessed within 30 days. Since hastebin is a javascript-obfuscated service, this file is not available on archive.org.
I am unable to find an email for niteshgupta16 in order to ask him if he still has uwuviteyeb.py.

mongodb has unexpectedly crashed

mongodb has unexpectedly crashed with following stack:
Sun Dec 29 11:30:43 [conn410] build index XXX { referral: 1 }
Sun Dec 29 11:30:43 [conn410] build index done 26597 records 0.056 secs
Sun Dec 29 11:30:43 Invalid access at address: 0
Sun Dec 29 11:30:43 Got signal: 11 (Segmentation fault).
Sun Dec 29 11:30:43 Backtrace:
0xa83fc9 0xa845a0 0x7fdad2200490 0x54d7dc 0x83d551 0x83d756 0x83d8b0 0x9493e3 0x8c0b66 0x8cd4b0 0x8cdb06 0x8d21ce 0x8d3be5 0x8d40e0 0x8d6200 0x94360d 0x948375 0x8823bc 0x885405 0xa96a46
/usr/bin/mongod(_ZN5mongo10abruptQuitEi+0x399) [0xa83fc9]
/usr/bin/mongod(_ZN5mongo24abruptQuitWithAddrSignalEiP7siginfoPv+0x220) [0xa845a0]
/lib64/libpthread.so.0(+0xf490) [0x7fdad2200490]
/usr/bin/mongod(_ZN5mongo24FieldRangeVectorIterator7advanceERKNS_7BSONObjE+0x4c) [0x54d7dc]
/usr/bin/mongod(_ZN5mongo11BtreeCursor29skipOutOfRangeKeysAndCheckEndEv+0x81) [0x83d551]
/usr/bin/mongod(_ZN5mongo11BtreeCursor12skipAndCheckEv+0x26) [0x83d756]
/usr/bin/mongod(_ZN5mongo11BtreeCursor7advanceEv+0x100) [0x83d8b0]
/usr/bin/mongod(_ZN5mongo8UpdateOp4nextEv+0x253) [0x9493e3]
/usr/bin/mongod(_ZN5mongo12QueryPlanSet6Runner6nextOpERNS_7QueryOpE+0x56) [0x8c0b66]
/usr/bin/mongod(_ZN5mongo12QueryPlanSet6Runner4nextEv+0x110) [0x8cd4b0]
/usr/bin/mongod(_ZN5mongo12QueryPlanSet6Runner22runUntilFirstCompletesEv+0x56) [0x8cdb06]
/usr/bin/mongod(_ZN5mongo12QueryPlanSet5runOpERNS_7QueryOpE+0x11e) [0x8d21ce]
/usr/bin/mongod(_ZN5mongo16MultiPlanScanner9runOpOnceERNS_7QueryOpE+0x525) [0x8d3be5]
/usr/bin/mongod(_ZN5mongo11MultiCursor10nextClauseEv+0x70) [0x8d40e0]
/usr/bin/mongod(_ZN5mongo11MultiCursorC1EPKcRKNS_7BSONObjES5_N5boost10shared_ptrINS0_8CursorOpEEEb+0x220) [0x8d6200]
/usr/bin/mongod(_ZN5mongo14_updateObjectsEbPKcRKNS_7BSONObjES2_bbbRNS_7OpDebugEPNS_11RemoveSaverE+0x35d) [0x94360d]
/usr/bin/mongod(_ZN5mongo13updateObjectsEPKcRKNS_7BSONObjES2_bbbRNS_7OpDebugE+0x125) [0x948375]
/usr/bin/mongod(_ZN5mongo14receivedUpdateERNS_7MessageERNS_5CurOpE+0x47c) [0x8823bc]
/usr/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x1105) [0x885405]
/usr/bin/mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x76) [0xa96a46]
Logstream::get called in uninitialized state
Sun Dec 29 11:30:43 ERROR: Client::~Client _context should be null but is not; client:conn
Logstream::get called in uninitialized state
Sun Dec 29 11:30:43 ERROR: Client::shutdown not called: conn
how can I know what caused the crashing? Is there another log that describes more details?

My app does not launch in my device?

I am having this problem, for the first time. I am running my app to device with distribution + Ad-Hoc provision profile but I can't able to launch app the first time in device, as I am getting this error continuously:
Mar 1 18:07:58 My-iPhon kernel[0] : launchd[276] Builtin profile: container (sandbox)
Mar 1 18:07:58 My-iPhon kernel[0] : launchd[276] Container: /private/var/mobile/Applications/E142C3CE-F6E0-4C77-ABE8-1B764DA216FE (sandbox)
Mar 1 18:07:58 My-iPhon com.apple.debugserver-189[261] : 1 +0.000000 sec [0105/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 276, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 276, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
Mar 1 18:07:58 My-iPhon mobile_house_arrest[280] : Max open files: 125
Mar 1 18:07:59 My-iPhon com.apple.debugserver-189[261] : 2 +0.417620 sec [0105/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 276, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 276, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
Mar 1 18:07:59 My-iPhon mobile_house_arrest[281] : Max open files: 125
Mar 1 18:07:59 My-iPhon mobile_house_arrest[282] : Max open files: 125
After I launch, the app crashed and in Device Console I got this error:
Mar 1 18:11:44 My-iPhon backboardd[52] : BKSendGSEvent ERROR sending event type 50: (ipc/send) invalid destination port (0x10000003)
Mar 1 18:11:44 My-iPhon com.apple.launchd[1] (UIKitApplication:com.xxx.myApp[0x3077][276]) : (UIKitApplication:com.xxxx.myapp[0x3077]) Exited: Killed: 9
Mar 1 18:11:44 My-iPhon com.apple.debugserver-189[261] : 21 +216.166834 sec [0105/0303]: RNBRunLoopLaunchInferior DNBProcessLaunch() returned error: 'failed to get the task for process 276'
Mar 1 18:11:44 My-iPhon com.apple.debugserver-189[261] : error: failed to launch process (null): failed to get the task for process 276
Mar 1 18:11:44 My-iPhon backboardd[52] : Application 'UIKitApplication:com.xxxxx.myApp[0x3077]' quit with signal 9: Killed: 9
However, the third time its running normally!
I have tried it many ways like
Recreated my provision profile and also given entitlement.plist for Ad-Hoc distribution
I set the scheme's build configuration to debug, so how can i solve this error while running my app first time on my device
I restated my device
No matter what I try, I get this error! Can any of you explain this?
You can try using development certificate. It will work fine if you install IPA file in your device.
Use Ad-hoc and distribution provisioning profiles when you are going to upload your app to the app store.