9 Replies Latest reply on Apr 12, 2017 11:01 AM by skawamoto RSS
    skawamoto Newbie

    Error occurred running Thingworx in Docker

    I am trying to run Thingworx with Docker.

    There is not one container, but Tomcat and Postgres.

     

     

    ■Enviroment

     

     ●Version

      ・Tomcat :8.0.41

      ・JDK :1.8.0_121

      ・Postgres :9.4

     

    ■Error

     

     ●Error occurrence procedure

      1.Execute initdb in the container of Postgres.

      2.Execute the following in the container of Postgres.

       ・thingworxPostgresDBSetup.sh

       ・thingworxPostgresSchemaSetup.sh

      3.Excute tomcat in the container of tomcat.

      4.Error occured.

      

     ●Error message

      

    ~~~

    com.thingworx.common.exceptions.ModelAccessException: ERROR: null value in column "is_property_provider_supported" violates not-null constraint

    Detail: Failing row contains (1, Server, 0, t, t, null, 809, 1, null, 6, 6, 0, b476, 2017-03-10 04:13:15.107).

    ~~~

    Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "is_property_provider_supported" violates not-null constraint

      Detail: Failing row contains (1, Server, 0, t, t, null, 809, 1, null, 6, 6, 0, b476, 2017-03-10 04:13:15.107).

    ~~~

    java.lang.Exception: Unable to initialize and start system: ERROR: null value in column "is_property_provider_supported" violates not-null constraint

    ~~~

     

     

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

     

    ■Postscript

     

     

      From the error message, it seems that the column "is_property_provider_supported" seems to be probleming, so I commented   out the line that adds this column from the thingworx-model-schema.sql file.

      Then, the following error message occurred.

      "Null value in column "property_schema_version" violates not-null constraint"

      So I also commented out the column "property_schema_version".

      As a result, I confirmed that Thingworx works normally.

      

     ●The actual thingworx-model-schema.sql file.

      

    CREATE TABLE IF NOT EXISTS system_version (

        pid serial primary key,

        server_name character varying(255) NOT NULL,

        server_code integer NOT NULL,

        is_data_provider_supported boolean NOT NULL,

        is_model_provider_supported boolean NOT NULL,

    --    is_property_provider_supported boolean NOT NULL,

        model_schema_version integer NOT NULL,

        data_schema_version integer NOT NULL,

    --    property_schema_version integer NOT NULL,

        major_version character varying(10) NOT NULL,

        minor_version character varying(10),

        revision character varying(45) NOT NULL,

        build character varying(45) NOT NULL,

        creationDate timestamp without time zone DEFAULT now()

    );

     

     ●Concerns

      

      If you modify this SQL file distributed from PTC like this,

      Will not an error occur at other times?

      • Re: Error occurred running Thingworx in Docker
        liliu Creator

        Hi Suguru,

         

        From you error log, it definitely be Postgresql issue.

         

        1. Did you install Postgresql successfully?

            Open pgAdimnIII to check if you can connect with you Postgresql.

        2 Did you connect Postgresql with ThingWorx properly?

            a. Add the <postgres-installation>/bin folder to your system path variable.

            b. Run commend in CMD thingworxpostgresDBSetup –a postgres –u twadmin –l C:\ThingworxPostgresqlStorage

         

            c. Run commend in CMD thingworxPostgresSchemaSetup.bat

            d. Check you ThingWorx_Platform folder and platform-settings.json file. Are the on the right place? Did you set the right username and password?

         

        Lily

          • Re: Error occurred running Thingworx in Docker
            skawamoto Newbie

            Hi Lily,

             

            Thank you for your reply!

             

             

            > 1. Did you install Postgresql successfully?

             

            I confirmed that I can connect to postgresql using pgadminⅢ.

            Therefore, the postgresql is installed correctly.

             

            > 2 Did you connect Postgresql with ThingWorx properly?

            >  a. Add the <postgres-installation>/bin folder to your system path variable.

            >  b. Run commend in CMD thingworxpostgresDBSetup –a postgres –u twadmin –l C:\ThingworxPostgresqlStorage

             

            I executed a command, but no error occurred.

             

            >  c. Run commend in CMD thingworxPostgresSchemaSetup.bat

             

            I executed a command, but no error occurred.

             

            >  d. Check you ThingWorx_Platform folder and platform-settings.json file. Are the on the right place? Did you set the right username and password?

             

            I put modelproviderconfig.json in the ThingWorx_Platform folder instead of platform-settings.json.

            User names and passwords have correct values written in JSON files.

            I tried to place platform-settings.json in the ThingWorx_Platform folder instead of modelproviderconfig.json.

            However, the same error message below occurred.

             

            ~~~

            java.lang.Exception: Unable to initialize and start system: ERROR: null value in column "is_property_provider_support

            ed" violates not-null constraint

            ~~~

             

             

            Suguru