Service of API Portal v4.2 can not started

Document ID : KB000101072
Last Modified Date : 14/06/2018
Show Technical Document Details
Issue:
Enrolled API Gateway twice to API Portal.
Afert that, HTTP 500 error appears on Portal site.
Also, Portal service does not start up properly.

Result of docker service ls:
ID                  NAME                        MODE                REPLICAS            IMAGE                                                                          PORTS
xwtvklbqr8aj        portal_analytics-server     global              1/1                 apim-portal.packages.ca.com/apim-portal/analytics-server:4.2.2.rc       
sp48u4z08gj0        portal_apim                 global              0/1                 apim-portal.packages.ca.com/apim-portal/ingress:4.2.2.rc                
p00s1pcq4sue        portal_apis                 replicated          1/1                 jarvis.packages.ca.com/analytics/jarvis_api:2.2.0.89                           *:8080->8080/tcp
ixmmqy0d0ima        portal_authenticator        global              1/1                 apim-portal.packages.ca.com/apim-portal/authenticator:4.2.2.rc          
vzdw43m4pb4k        portal_dispatcher           global              0/1                 apim-portal.packages.ca.com/apim-portal/dispatcher:4.2.2.rc             
46aipqfmaru8        portal_elasticsearch        global              1/1                 jarvis.packages.ca.com/analytics/elasticsearch-5.5.3:2.2.0.130          
odrew4yzicsn        portal_indexer              replicated          1/1                 jarvis.packages.ca.com/analytics/jarvis_indexer:2.2.0.43                
2meqlr2hdgph        portal_kafka1               replicated          1/1                 jarvis.packages.ca.com/analytics/hotfix/kafka-0.10.1.0:2.2.0.5          
v1vhovflm5w8        portal_kron                 replicated          1/1                 jarvis.packages.ca.com/analytics/jarvis_kron:2.2.0.19                          *:8081->8080/tcp
hczbctnsve69        portal_ldds-web             replicated          1/1                 jarvis.packages.ca.com/analytics/ldds:2.1.8.1                           
eq7fybl668pm        portal_portal-data          global              1/1                 apim-portal.packages.ca.com/apim-portal/portal-data:4.2.2.rc            
oxc95vdvwzun        portal_portal-enterprise    global              1/1                 apim-portal.packages.ca.com/apim-portal/portal-enterprise:4.2.2.rc      
p6eeu934a6nv        portal_portaldb             replicated          1/1                 apim-portal.packages.ca.com/apim-portal/postgres:4.2.2.rc               
0hqom6a0hgxm        portal_portaldb-slave       replicated          1/1                 apim-portal.packages.ca.com/apim-portal/postgres:4.2.2.rc               
mamuftm3m50v        portal_pssg                 global              1/1                 apim-portal.packages.ca.com/apim-portal/pssg:4.2.2.rc                   
1zr1p8ro9emt        portal_rabbitmq             replicated          1/1                 apim-portal.packages.ca.com/apim-portal/message-broker:4.2.2.rc         
0st209s0wguj        portal_rabbitmq-worker      global              1/1                 apim-portal.packages.ca.com/apim-portal/message-broker:4.2.2.rc         
51qw8lvbtfg6        portal_schemaregistry       replicated          1/1                 jarvis.packages.ca.com/analytics/jarvis_schema_registry:2.2.0.10        
h8zgj4k7i5wh        portal_smtp                 replicated          1/1                 apim-portal.packages.ca.com/apim-portal/smtp:4.2.2.rc                   
5zexw98pfelg        portal_solr                 replicated          1/1                 apim-portal.packages.ca.com/apim-portal/solr:4.2.2.rc                   
70irivhcozvo        portal_tenant-provisioner   replicated          1/1                 apim-portal.packages.ca.com/apim-portal/tenant-provisioning-service:4.2.2.rc
sh4m20y19ikt        portal_utils                replicated          1/1                 jarvis.packages.ca.com/analytics/jarvis_es_utils:2.2.0.81               
kms5ky0qesfa        portal_verifier             replicated          1/1                 jarvis.packages.ca.com/analytics/jarvis_verifier:2.2.0.42               
g8sk7b8c0d3n        portal_zookeeper1           replicated          1/1                 jarvis.packages.ca.com/analytics/zookeeper-3.4.8:2.2.0.122        

Can not start "portal_apim" and "portal_dispatcher"

Reproduction procedure:

First time:
-Create Tenant Record (Tenant name: A)
-Enroll a Gateway (Proxy Name: a) ⇒ URL Copy
- Perform "Update Portal Integration" from Policy Manager
- Confirm that "Portal APIs" folder and each service are displayed from Policy Manger.

Second time: 
-Create Tenant Record (Tenant name: B)
-Enroll a Gateway (Proxy Name: b) ⇒ URL Copy
- Perform "Update Portal Integration" from Policy Manager
- Confirm that "Portal APIs" folder and each service are displayed from Policy Manger.


 
Environment:
CA API Developer Portal - 4.2
Cause:
The cause is because same Gateway was enrolled twice.
Do not do so as it may cause a malfunction.
Resolution:
Clean up of the environment is necessary.

For the cleanup method, refer to the following technical text.
https://comm.support.ca.com/kb/how-to-clean-the-portal-docker-stack-after-a-failed-installation/kb000072691

Please also clean up  according to the procedure of "Failed Gateway Deployment" in the following document.
https://docops.ca.com/ca-api-developer-portal-enhanced-experience/4-2/en/install-configure-and-upgrade/post-installation-tasks/enroll-a-ca-api- gateway