search cancel

API Developer Portal: Portal.sh startup script runs in loops when not using default/known tenant ID for first (and only) tenant in environment.

book

Article ID: 189523

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

This article discusses a rare issue that is found in the portal.sh script used for starting up the API Developer Portal ("Portal"). A workaround is provided, and it is a known issue that will be resolved in a future release. This will usually only occur when a non-default tenant ID is used for the first and only tenant in the environment. In this situation, it can appear that the portal.sh script never completes, going in loops because it never finds the default tenant ID.

Cause

There is a hardcoded part of the portal.sh script that is expecting a known/default tenant ID. When an environment only has one tenant and that tenant is not one recommended in the documentation / expected by the script, it will run in a loop. 

Environment

This articles applies to Portal 4.5 and below.

Resolution

This will be fixed in a future release of the Portal. In the meantime, a workaround exists to manually edit the portal.sh script to allow for a new line to be added in a particular section:

As of Portal 4.4, the line number to add the statement below is below line 518, however this line number may be different in other versions of Portal. Be sure to look for the entire fragment to ensure this is being done in the right spot. Also, a backup is critically important.

Workaround steps:
  1. Append the following line after line 518 (as of Portal 4.4) in the portal.sh script: echo "TSSG_TENANT_ID={{ user.PORTAL_TENANT_ID }}" >> ${DOCKER_CONFIG}/env-db
  2. Save the file.
After modification, the block of code should look similar to the following:

function config {
    tag_line=$(grep -n '^UUE:$' "$0" | cut -d ':' -f 1)
    if [[ -z $tag_line ]]; then
        return
    fi
    DOCKER_CONFIG=$(mktemp -d)
    TEMP_CONFIG=${DOCKER_CONFIG}
    tail -n +$((tag_line + 1)) "$0" | base64 -d | tar xzC "$DOCKER_CONFIG"
    echo "TSSG_TENANT_ID={{ user.PORTAL_TENANT_ID }}" >> ${DOCKER_CONFIG}/env-db
}