Re: Docker Container Restart Problems


Michael C. Jaeger
 

Hello flp,

 

I am not very familiar with docker, so I do not have a good insight on what you do with your custom docker file cited at the end. I checked out current master and executed docker-compose up and down and up and down with uploading packages in between - > no issues at all.

 

Would there be any context information (like an old image laying around which is not subject for update) for your setup? Or did you create the docker-compose setup from scratch just based on the attached docker-compose.yml ?

 

Kind regards,

  Michael

 

From: <main@...> on behalf of "flp via lists.fossology.org" <flp=mailbox.org@...>
Reply to: "main@..." <main@...>
Date: Saturday, 24. October 2020 at 06:16
To: "main@..." <main@...>
Subject: [FOSSology] Docker Container Restart Problems

 

Hey,

I try to run fossology as docker compose cluster. Unfortunately, it always crashes when I need to restart the fossology container (3.7.0, 3.8.1 or 3.9.0-rc2).

I end up with the following error in 3.8.1 und 3.9.0:

*** Running postinstall for common actions***

*** Creating user and group ***

NOTE: group 'fossy' already exists, good.

NOTE: user 'fossy' already exists, good.

*** Making sure needed dirs exist with right ownership/permissions ***

*** clearing file cache ***

NOTE: Repository already exists at /srv/fossology/repository

NOTE: Running the PostgreSQL vacuum and analyze command can result in a large database performance improvement.

      We suggest that you either configure postgres to run its autovacuum and autoanalyze daemons, or maintagent -D in a cron job, or run Admin > Maintenance on a regular basis.

      Admin > Dashboard will show you the last time vacuum and analyze have been run.

NOTE: using external DB on host foss-db

*** update the database and license_ref table ***

PHP Warning:  syntax error, unexpected ')' in /usr/local/etc/fossology/Db.conf on line 4

 in /usr/local/share/fossology/lib/php/common-sysconfig.php on line 96

PHP Warning:  Invalid argument supplied for foreach() in /usr/local/share/fossology/lib/php/common-sysconfig.php on line 101

PHP Notice:  Undefined index: user in /usr/local/share/fossology/lib/php/libschema.php on line 520

Old release was 3.0.1

*** Cleaning tables for new constraints ***

Table author or agent does not exists, not cleaning!

Table author or pfile does not exists, not cleaning!

Table bucket_container or bucket_def does not exists, not cleaning!

Table bucket_file or bucket_def does not exists, not cleaning!

Table bucket_file or pfile does not exists, not cleaning!

Table copyright or agent does not exists, not cleaning!

Table copyright_decision or pfile does not exists, not cleaning!

Table ecc or agent does not exists, not cleaning!

Table ecc or pfile does not exists, not cleaning!

Table ecc_decision or pfile does not exists, not cleaning!

Table highlight_keyword or pfile does not exists, not cleaning!

Table keyword or agent does not exists, not cleaning!

Table keyword or pfile does not exists, not cleaning!

Table keyword_decision or pfile does not exists, not cleaning!

Table pkg_deb_req or pkg_deb does not exists, not cleaning!

Table pkg_rpm_req or pkg_rpm does not exists, not cleaning!

Table report_cache or upload does not exists, not cleaning!

Table report_info or upload does not exists, not cleaning!

Table reportgen or upload does not exists, not cleaning!

Table upload or pfile does not exists, not cleaning!

Table upload_clearing_license or upload does not exists, not cleaning!

Table obligation_ref does not exists, not cleaning!

Table report_info does not exists, not cleaning!

Table obligation_ref does not exists, not cleaning!

Table group_user_member does not exists, not cleaning!

Removed 0 rows from tables with new constraints

PHP Notice:  Undefined index: user in /usr/local/share/fossology/lib/php/libschema.php on line 520

PHP Warning:  pg_query(): Query failed: ERROR:  column "rf_copyleft" of relation "license_ref" already exists in /usr/local/share/fossology/lib/php/Db/Driver/Postgres.php on line 79

[2020-10-18 21:38:19] /usr/local/share/fossology/lib/php/libschema.php.CRITICAL: ERROR:  column "rf_copyleft" of relation "license_ref" already exists [] []

PHP Fatal error:  Uncaught Fossology\Lib\Exception: error executing: ALTER TABLE "license_ref" ADD COLUMN "rf_copyleft" bit(1)

 

ERROR:  column "rf_copyleft" of relation "license_ref" already exists in /usr/local/share/fossology/lib/php/Db/DbManager.php:144

Stack trace:

#0 /usr/local/share/fossology/lib/php/Db/DbManager.php(203): Fossology\Lib\Db\DbManager->checkResult(false, 'ALTER TABLE "li...')

#1 /usr/local/share/fossology/lib/php/libschema.php(299): Fossology\Lib\Db\DbManager->queryOnce('ALTER TABLE "li...')

#2 /usr/local/share/fossology/lib/php/libschema.php(161): fo_libschema->applyTables()

#3 /usr/local/lib/fossology/fossinit.php(196): fo_libschema->applySchema('/usr/local/shar...', false, 'fossology', Array)

#4 {main}

  thrown in /usr/local/share/fossology/lib/php/Db/DbManager.php on line 144


With 3.7.0 I get the following:

*** Running postinstall for common actions***

*** Creating user and group ***

NOTE: group 'fossy' already exists, good.

NOTE: user 'fossy' already exists, good.

*** Making sure needed dirs exist with right ownership/permissions ***

*** clearing file cache ***

NOTE: Repository already exists at /srv/fossology/repository

NOTE: Running the PostgreSQL vacuum and analyze command can result in a large database performance improvement.

      We suggest that you either configure postgres to run its autovacuum and autoanalyze daemons, or maintagent -D in a cron job, or run Admin > Maintenance on a regular basis.

      Admin > Dashboard will show you the last time vacuum and analyze have been run.

NOTE: using external DB on host foss-db

*** update the database and license_ref table ***

PHP Warning:  syntax error, unexpected ')' in /usr/local/etc/fossology/Db.conf on line 4

 in /usr/local/share/fossology/lib/php/common-sysconfig.php on line 96

PHP Warning:  Invalid argument supplied for foreach() in /usr/local/share/fossology/lib/php/common-sysconfig.php on line 101

PHP Notice:  Undefined index: user in /usr/local/share/fossology/lib/php/libschema.php on line 520

Old release was 0

*** Cleaning tables for new constraints ***

Table author or agent does not exists, not cleaning!

Table author or pfile does not exists, not cleaning!

Table bucket_container or bucket_def does not exists, not cleaning!

Table bucket_file or bucket_def does not exists, not cleaning!

Table bucket_file or pfile does not exists, not cleaning!

Table copyright or agent does not exists, not cleaning!

Table copyright_decision or pfile does not exists, not cleaning!

Table ecc or agent does not exists, not cleaning!

Table ecc or pfile does not exists, not cleaning!

Table ecc_decision or pfile does not exists, not cleaning!

Table highlight_keyword or pfile does not exists, not cleaning!

Table keyword or agent does not exists, not cleaning!

Table keyword or pfile does not exists, not cleaning!

Table keyword_decision or pfile does not exists, not cleaning!

Table pkg_deb_req or pkg_deb does not exists, not cleaning!

Table pkg_rpm_req or pkg_rpm does not exists, not cleaning!

Table report_cache or upload does not exists, not cleaning!

Table report_info or upload does not exists, not cleaning!

Table reportgen or upload does not exists, not cleaning!

Table upload or pfile does not exists, not cleaning!

Table upload_clearing_license or upload does not exists, not cleaning!

Table obligation_ref does not exists, not cleaning!

Table report_info does not exists, not cleaning!

Table obligation_ref does not exists, not cleaning!

Table group_user_member does not exists, not cleaning!

Removed 0 rows from tables with new constraints

PHP Notice:  Undefined index: user in /usr/local/share/fossology/lib/php/libschema.php on line 520

PHP Warning:  pg_query(): Query failed: ERROR:  column "option_value" of relation "sysconfig" already exists in /usr/local/share/fossology/lib/php/Db/Driver/Postgres.php on line 79

[2020-10-22 21:49:47] /usr/local/share/fossology/lib/php/libschema.php.CRITICAL: ERROR:  column "option_value" of relation "sysconfig" already exists [] []

PHP Fatal error:  Uncaught Fossology\Lib\Exception: error executing: ALTER TABLE "sysconfig" ADD COLUMN "option_value" character varying(40) DEFAULT NULL

 

ERROR:  column "option_value" of relation "sysconfig" already exists in /usr/local/share/fossology/lib/php/Db/DbManager.php:144

Stack trace:

#0 /usr/local/share/fossology/lib/php/Db/DbManager.php(203): Fossology\Lib\Db\DbManager->checkResult(false, 'ALTER TABLE "sy...')

#1 /usr/local/share/fossology/lib/php/libschema.php(299): Fossology\Lib\Db\DbManager->queryOnce('ALTER TABLE "sy...')

#2 /usr/local/share/fossology/lib/php/libschema.php(161): fo_libschema->applyTables()

#3 /usr/local/lib/fossology/fossinit.php(191): fo_libschema->applySchema('/usr/local/shar...', false, 'fossology', Array)

          #4 {main} thrown in /usr/local/share/fossology/lib/php/Db/DbManager.php on line 144

I'm using fossology with the following compose cluster:

version: '3.8'
services:
  foss:
    image: fossology/fossology:3.9.0-rc2
    restart: unless-stopped
    environment:
      FOSSOLOGY_DB_HOST:
      FOSSOLOGY_DB_NAME:
      FOSSOLOGY_DB_USER:
      FOSSOLOGY_DB_PASSWORD:
    volumes:
      - ./foss-repo:/srv/fossology/repository/
    networks:
      - foss
    depends_on:
      - foss-db
  foss-db:
    image: postgres:11
    restart: unless-stopped
    environment:
      POSTGRES_DB:
      POSTGRES_USER:
      POSTGRES_PASSWORD:
      POSTGRES_INITDB_ARGS: '-E SQL_ASCII'
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
    networks:
      - foss
networks:
  foss:
    external:
      name: foss


I have no particular experience with Php but it looks like the startup script is always executed within the docker container so I might need to create my own one that does not execute the database script at startup?


Join main@lists.fossology.org to automatically receive all group messages.