Portal fails to start after prune -a and restart of the portal
search cancel

Portal fails to start after prune -a and restart of the portal

book

Article ID: 402173

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

While portal is running to clean space we prune unused containers 

# prune -a 

Then restarted the portal (./portal.sh) resulted in production down.

The portal.sh hangs: 

# ./portal.sh

Creating network portal_db

Creating service portal_db-upgrade

Creating service portal_db-upgrade-rbac

Checking to see if DB schema update is needed............................

 

Environment

Portal 5.3.1

Cause

The docker # prune -a will remove all NONE running containers & images.  The db-upgrade images are shutdown after portal start, resulting in them getting removed by # prune -a

When the portal is restarted the script checks for upgrade by starting and loading portal_db_upgrade and portal_db-upgrade-rbac. Needs access to https://hub.docker.com/u/caapim OR folder images in the portal home

 

Resolution

In the future just prune this will not remove the stopped image for upgrade

# docker system prune

WARNING! This will remove:

  - all stopped containers

  - all networks not used by at least one container

  - all dangling images

  - unused build cache

 

Are you sure you want to continue? [y/N] y

 Stopped container with images remain:

$  docker images

REPOSITORY                           TAG       IMAGE ID       CREATED        SIZE

.

caapim/db-upgrade-portal             5.3.1     b2cd6a097fcd   8 months ago   385MB

.

caapim/db-upgrade-rbac               5.3.1     34e7bf0f5735   8 months ago   384MB

.

ALSO best practice keep gz of the images folder for the version of portal

When the portal starts it removes the images folder 

Backup save images before starting

# tar -zcvf images-5.2.3.tar.gz images

# tar -xzvf images-5.2.3.tar.gz