# pmm-client initContainer fails to start with exitcode 3

**URL:** <https://forums.percona.com/t/pmm-client-initcontainer-fails-to-start-with-exitcode-3/7776>\
**Category:** PMM 2.x\
**Created:** [July 15, 2020, 7:41am UTC](https://forums.percona.com/t/pmm-client-initcontainer-fails-to-start-with-exitcode-3/7776 "2020-07-15T07:41:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugene\_burachevskiy](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/eugene_burachevskiy/32/1362_2.png) [@eugene\_burachevskiy](https://forums.percona.com/u/eugene_burachevskiy)\
**Post date:** [July 15, 2020, 7:41am UTC](https://forums.percona.com/t/pmm-client-initcontainer-fails-to-start-with-exitcode-3/7776/1 "2020-07-15T07:41:15Z")

</div>

Hi guys!  
I’m trying to setup PMM based monitoring for perconaservermongodb kubernetes operator.  
Server part with percona/pmm-server Helm chart is OK.  
But clients are not. I’m setting them with following definition in perconaservermongodbs CR:  
  
pmm:  
&nbsp;&nbsp;&nbsp; enabled: true  
&nbsp;&nbsp;&nbsp; image: percona/percona-server-mongodb-operator:1.4.0-pmm  
&nbsp;&nbsp;&nbsp; serverHost: pmm-service.psmdb  
&nbsp;&nbsp;&nbsp; serverUser: admin  
  
I have also updated “my-cluster-name-secrets” secret to have proper usernames/passwords.  
pmm-client initContainer is always failing with exitcode 3:  
  
&nbsp; - containerID: docker://baf2ea49ad054eed8972cd65d31437ae248b22d8beb55adf00f6ed13d3452db8  
&nbsp;&nbsp;&nbsp; image: percona/percona-server-mongodb-operator:1.4.0-pmm  
&nbsp;&nbsp;&nbsp; imageID: docker-pullable://percona/percona-server-mongodb-operator@sha256:bf0cdfd9f9971964cb720a92e99da1a75367cf6a07deec9367ca6b80e78b0f89  
&nbsp;&nbsp;&nbsp; lastState:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; terminated:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; containerID: docker://f276c66f0a47d8ce6f626645ffb3255fc03926f961d82de399282972f1af6fd3  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exitCode: 3  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finishedAt: “2020-07-15T11:11:34Z”  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reason: Error  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; startedAt: “2020-07-15T11:11:24Z”  
  
  
Logs are also not so informative:  
  
+ main  
+ ‘[’ -z pmm-service.psmdb ‘]’  
+ ARGS+=“–server-password=PMM\_PASSWORD”  
++ sed -e ‘s/)._//; s/._(//’  
++ grep PING  
++ ping -c 1 pmm-service.psmdb  
+ PMM\_SERVER\_IP=172.20.15.45  
++ ip route get 172.20.15.45  
++ grep 'src '  
++ sed -e ‘s/.\* src //; s/ .\*//’  
+ SRC\_ADDR=10.240.90.250  
+ CLIENT\_NAME=dev-core-rs0-2  
  
  
At least according to this logs we can see that pmm-server k8s service is resolved properly and reachable.  
Then I checked pmm-client docker image entrypoint.sh and I’m pretty sure that error with exitcode 3 happens on that part of main() function:  
  
  
{ set +x; } 2\> /dev/null  
&nbsp;&nbsp;&nbsp; SERVER\_RESPONSE\_CODE=$(curl -k -s -o /dev/null -w “%{http\_code}” “https://${PMM\_USER}:$(urlencode ${PMM\_PASSWORD})@${PMM\_SERVER}/v1/readyz”)  
&nbsp;&nbsp;&nbsp; set -x  
  
  
Because in log we can see succesfull assignment of CLIENT\_NAME variable, but pmm2\_start() function hasn’t started yet, as we dont see echo output from its begining.  
  
The strange thing is that those command works fine when I run it from another shell pod:  
  
[root@shell /]# echo ${PMM\_USER}  
admin  
[root@shell /]# echo ${PMM\_SERVER}  
pmm-service.psmdb  
[root@shell /]# curl -k -s -o /dev/null -w “%{http\_code}” “https://${PMM\_USER}:$(urlencode ${PMM\_PASSWORD})@${PMM\_SERVER}/v1/readyz”  
200[root@shell /]# echo $?  
0  
[root@shell /]#  
  
  
I am not sure where to go next… Maybe somebody has faced something similar before or may advice some ideas for further troubleshoot?  
  
Thank you!

---

<div class="post-metadata">

**Author:** ![Tobias](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/tobias/32/1371_2.png) [@Tobias](https://forums.percona.com/u/Tobias)\
**Post date:** [August 13, 2020, 12:56am UTC](https://forums.percona.com/t/pmm-client-initcontainer-fails-to-start-with-exitcode-3/7776/2 "2020-08-13T00:56:38Z")

</div>

I’m also struggling to get pmm running with the mongodb operator.  
It manages to register the mongodb in PMM, but then dies after:

```auto
INFO[2020-08-13T06:22:53.513+00:00] time="2020-08-13T06:22:53Z" level=info msg=" - uname" source="node_exporter.go:105" agentID=/agent_id/854e6754-4ea8-4393-abe7-6604e6a060e6 component=agent-process type=node_exporter
INFO[2020-08-13T06:22:53.513+00:00] time="2020-08-13T06:22:53Z" level=info msg=" - vmstat" source="node_exporter.go:105" agentID=/agent_id/854e6754-4ea8-4393-abe7-6604e6a060e6 component=agent-process type=node_exporter
INFO[2020-08-13T06:22:53.513+00:00] time="2020-08-13T06:22:53Z" level=info msg="HTTP Basic authentication is enabled." source="basic_auth.go:91" agentID=/agent_id/854e6754-4ea8-4393-abe7-6604e6a060e6 component=agent-process type=node_exporter
INFO[2020-08-13T06:22:53.513+00:00] time="2020-08-13T06:22:53Z" level=info msg="Starting HTTP server for http://:30100/metrics ..." source="server.go:140" agentID=/agent_id/854e6754-4ea8-4393-abe7-6604e6a060e6 component=agent-process type=node_exporter
+ pmm-admin add "mongodb" \
--skip-connection-check \
--server-url="https://xxxxx:xxxxx@${PMM_SERVER}/" \
--server-insecure-tls \
'--uri=mongodb://cluster-monitor:[REDACTED]@127.0.0.1:27017/ i-c31250bc-d115-4a9e-80f2-8d29600439ec-bla-rs0-2 :'
pmm-admin: error: unknown long flag '--uri', try --help

```

Yes, the whitespace in the `--uri` line is suspicious, and I don’t know where it comes from. Also pmm-admin should have a --uri flag, although not sure if it shuold be inside '-quotes.  
It’s all weird.
