OktaProvisioningAgent.pid permission denied

Hello,

We just restarted the Linux On Prem agent machine and now the Agent does not start:

Jun 23 10:19:25 localhost.localdomain OktaProvisioningAgent[3407]: /opt/OktaProvisioningAgent/OktaProvisioningAgent: line 28: /var/run/OktaProvisioningAgent.pid: Permission denied
Jun 23 10:19:25 localhost.localdomain runuser[3417]: pam_unix(runuser:session): session closed for user provisioningagent
Jun 23 10:19:25 localhost.localdomain OktaProvisioningAgent[3407]: [FAILED]
Jun 23 10:19:25 localhost.localdomain systemd[1]: OktaProvisioningAgent.service: Control process exited, code=exited status=1
Jun 23 10:19:25 localhost.localdomain systemd[1]: OktaProvisioningAgent.service: Failed with result ‘exit-code’.
Jun 23 10:19:25 localhost.localdomain systemd[1]: Failed to start SYSV: OktaProvisioningAgent Agent server daemon.

We installed it before with https://help.okta.com/en/prod/Content/Topics/Provisioning/opp/OPP-install-agent.htm

Do you know what can be wrong and how to fix?

Thank you!

tried reinstalling and worked but with every restart it gives same error

root@XXXXXXXXX aroraa5]# systemctl status OktaProvisioningAgent.service -l
● OktaProvisioningAgent.service - SYSV: OktaProvisioningAgent Agent server daemon
Loaded: loaded (/etc/rc.d/init.d/OktaProvisioningAgent; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2020-10-08 17:47:55 CEST; 7min ago
Docs: man:systemd-sysv-generator(8)
Process: 6531 ExecStart=/etc/rc.d/init.d/OktaProvisioningAgent start (code=exited, status=1/FAILURE)
CGroup: /system.slice/OktaProvisioningAgent.service
├─4583 /opt/OktaProvisioningAgent/jre/bin/java -Dagent_home=/opt/OktaProvisioningAgent -Xmx4096m -jar /opt/OktaProvisioningAgent/bin/OktaProvisioningAgent.jar -mode normal -configFilePath /opt/OktaProvisioningAgent/conf/OktaProvisioningAgent.conf
├─5135 /opt/OktaProvisioningAgent/jre/bin/java -Dagent_home=/opt/OktaProvisioningAgent -Xmx4096m -jar /opt/OktaProvisioningAgent/bin/OktaProvisioningAgent.jar -mode normal -configFilePath /opt/OktaProvisioningAgent/conf/OktaProvisioningAgent.conf
└─6551 /opt/OktaProvisioningAgent/jre/bin/java -Dagent_home=/opt/OktaProvisioningAgent -Xmx4096m -jar /opt/OktaProvisioningAgent/bin/OktaProvisioningAgent.jar -mode normal -configFilePath /opt/OktaProvisioningAgent/conf/OktaProvisioningAgent.conf

Oct 08 17:47:54 XXXXXXXXX OktaProvisioningAgent[6531]: Oct 08, 2020 5:47:54 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
Oct 08 17:47:54 XXXXXXXXX OktaProvisioningAgent[6531]: INFO: Loading XML bean definitions from class path resource [spring/agent.xml]
Oct 08 17:47:54 XXXXXXXXX OktaProvisioningAgent[6531]: Oct 08, 2020 5:47:54 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
Oct 08 17:47:54 XXXXXXXXX OktaProvisioningAgent[6531]: INFO: Loading XML bean definitions from class path resource [spring/entities.xml]
Oct 08 17:47:55 XXXXXXXXX OktaProvisioningAgent[6531]: /opt/OktaProvisioningAgent/OktaProvisioningAgent: line 28: /var/run/OktaProvisioningAgent.pid: Permission denied
Oct 08 17:47:55 XXXXXXXXX OktaProvisioningAgent[6531]: [FAILED]
Oct 08 17:47:55 XXXXXXXXX systemd[1]: OktaProvisioningAgent.service: control process exited, code=exited status=1
Oct 08 17:47:55 XXXXXXXXX systemd[1]: Failed to start SYSV: OktaProvisioningAgent Agent server daemon.
Oct 08 17:47:55 XXXXXXXXX systemd[1]: Unit OktaProvisioningAgent.service entered failed state.
Oct 08 17:47:55 XXXXXXXXX systemd[1]: OktaProvisioningAgent.service failed.

when the agent goes down my auto scaling is bringing up a new one but after in the second instance it throws above and now first instance itself is not there .

How should we overcome this issue. its typical to handle agent in Auto scaling.