Mongodb node getting uregistred

I am running percona client in a container. Nodes are getting unregistred after i restart the client .

Hi, please provide the steps you are taking and the expected result along with more details about exactly what problem you are seeing. Are nodes visible in PMM inventory page?

I have launched the client in container . If the client gets restarted it reiniliazes and nodes get unregistred

Hi Pramod, As requested by Ivan earlier, we will need these details (including command and logs) to troubleshoot it better. Please provide us with those details, like what command you used to register the PMM client? Also, please share the command output (pmm status/inventory status list, etc.) to understand it better.

so i already have mongo cluster running inside docker
i am using this docker compose file to run client

version: ‘3.9’

networks:
perconNetwork:
name: perconNetwork
driver: bridge

services:
mongo-1-pmm-client:
image: percona/pmm-client:2
container_name: mongo-1-pmm-client
environment:
PMM_AGENT_SERVER_ADDRESS: pmm-server
PMM_AGENT_SERVER_USERNAME: admin
PMM_AGENT_SERVER_PASSWORD: pramod # Password set to “pramod”
PMM_AGENT_SERVER_INSECURE_TLS: ‘1’
PMM_AGENT_SETUP: ‘1’
PMM_AGENT_CONFIG_FILE: config/pmm-agent.yaml
PMM_AGENT_PRERUN_SCRIPT: “pmm-admin status --wait=10s; pmm-admin add mongodb --username=pmm --password=pmm --host=mongo1 mongo1 --query-source=profiler --replication-set=myReplicaSet --cluster=P1 --enable-all-collectors --max-collections-limit=50000”

volumes:
  - pmm-client-data-1:/srv
restart: always
networks:
  - perconNetwork

mongo-2-pmm-client:
image: percona/pmm-client:2
container_name: mongo-2-pmm-client
environment:
PMM_AGENT_SERVER_ADDRESS: pmm-server
PMM_AGENT_SERVER_USERNAME: admin
PMM_AGENT_SERVER_PASSWORD: pramod # Password set to “pramod”
PMM_AGENT_SERVER_INSECURE_TLS: ‘1’
PMM_AGENT_SETUP: ‘1’
PMM_AGENT_CONFIG_FILE: config/pmm-agent.yaml
PMM_AGENT_PRERUN_SCRIPT: “pmm-admin status --wait=10s; pmm-admin add mongodb --username=pmm --password=pmm --host=mongo2 mongo2 --query-source=profiler --replication-set=myReplicaSet --cluster=P1 --enable-all-collectors --max-collections-limit=50000”

volumes:
  - pmm-client-data-2:/srv
restart: always
networks:
  - perconNetwork

mongo-3-pmm-client:
image: percona/pmm-client:2
container_name: mongo-3-pmm-client
environment:
PMM_AGENT_SERVER_ADDRESS: pmm-server
PMM_AGENT_SERVER_USERNAME: admin
PMM_AGENT_SERVER_PASSWORD: pramod # Password set to “pramod”
PMM_AGENT_SERVER_INSECURE_TLS: ‘1’
PMM_AGENT_SETUP: ‘1’
PMM_AGENT_CONFIG_FILE: config/pmm-agent.yaml
PMM_AGENT_PRERUN_SCRIPT: “pmm-admin status --wait=10s; pmm-admin add mongodb --username=pmm --password=pmm --host=mongo3 mongo3 --query-source=profiler --replication-set=myReplicaSet --cluster=P1 --enable-all-collectors --max-collections-limit=50000”

volumes:
  - pmm-client-data-3:/srv
restart: always
networks:
  - perconNetwork

volumes:
pmm-client-data-1:
driver: local
pmm-client-data-2:
driver: local
pmm-client-data-3:
driver: local

Now if the if start the client it fialis to restart showing the error
node already exists.
So in order to restart the i need to remove it manually from server then i am able restart the client.
Also if my host gets restarted client get in restarting stage automatically beacuse of this issue
is there nay solution to this .

Hi, given that you are trying to add the service each time the container starts, your config needs to include

PMM_AGENT_SETUP_FORCE: 1