Open APIs

 View Only
  • 1.  sample implementation code for TMF622 - connect ECONNREFUSED 127.0.0.1:27017

    Posted Dec 18, 2023 01:48

    Hello There,

    I am attempting to get sample implementation code for TMF622 running in a Docker container on my local Windows PC. 

    I have created a docker-compose file with the following entries.

    version: '3.9'

    services:

        mongo:

            image: mongo:latest

            container_name: mongo

            environment:

                MONGO_INITDB_ROOT_USERNAME: mongodb

                MONGO_INITDB_ROOT_PASSWORD: mongodb

            ports: ['27017:27017']

            volumes: ['tmf:/data/db']

        tmf622:

            build: .

            image: tmforumorg/api-productorderingmanagement_tmf-622:5.0.0

            container_name: product

            ports: ['8622:8622']

            stdin_open: true

            tty: true

            environment:

                - dbhost=mongo

                - dbport=27017

    volumes:

        tmf: {}

    I have run,

    docker build .

    docker compose up

    Everything seems to be running smoothly, I can get to the URL's and can see the swagger page, I can get to the DB via MongoCompass, but when I try to run create product example in swagger I get the following error.

    2023-12-18 16:17:47 product  | info: Service::serve: POST createProductOrder

    2023-12-18 16:17:47 product  | info: Service::create: createProductOrder ProductOrder

    2023-12-18 16:17:47 product  | info: ... replace requestedCompletionDate with native Date type

    2023-12-18 16:17:47 product  | info: ... replace requestedStartDate with native Date type

    2023-12-18 16:17:47 product  | info: ... replace date with native Date type

    2023-12-18 16:17:47 product  | info: ... processMissingProperties: ProductOrder

    2023-12-18 16:17:47 product  | info: populateMandatoryAttributes: type=ProductOrder

    2023-12-18 16:17:47 product  | info: ... processExcludedInPost: ProductOrder ProductOrder_Create

    2023-12-18 16:17:47 product  | info: ... processExcludedInPost: undefined not found

    2023-12-18 16:18:17 product  | info: mongo::connect err=MongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017

    2023-12-18 16:18:17 product  | info: mongo::create error=MongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017

    2023-12-18 16:18:17 product  | info: handleRequest:: error={

    2023-12-18 16:18:17 product  |   "error": {

    2023-12-18 16:18:17 product  |     "code": "1",

    2023-12-18 16:18:17 product  |     "reason": "Internal database error",

    2023-12-18 16:18:17 product  |     "message": "Internal Server Error"

    2023-12-18 16:18:17 product  |   },

    2023-12-18 16:18:17 product  |   "code": 500

    2023-12-18 16:18:17 product  | }

    Regards Bryn



    ------------------------------
    Bryn Langdown
    Aussie Broadband Limited
    ------------------------------


  • 2.  RE: sample implementation code for TMF622 - connect ECONNREFUSED 127.0.0.1:27017

    Posted Dec 18, 2023 02:54

    Hello Bryn,

    Ensure Swagger UI accessibility in the development environment by either modifying the environment to "dev" or adjusting the application middleware conditions. Consider removing the Swagger middleware from conditional checks to streamline access during development.



    ------------------------------
    Ragavi Ramasamy
    Halleyx Inc.
    ------------------------------



  • 3.  RE: sample implementation code for TMF622 - connect ECONNREFUSED 127.0.0.1:27017

    Posted Dec 18, 2023 03:34

    Hi Ragavi, 

    Wow, thank you for your really quick reply! Unfortunately I've only been working with the sample implementation code for a shore time so I'm not to sure how to make theses changes.

    Cheers Bryn

      



    ------------------------------
    Bryn Langdown
    Aussie Broadband Limited
    ------------------------------



  • 4.  RE: sample implementation code for TMF622 - connect ECONNREFUSED 127.0.0.1:27017

    Posted Dec 18, 2023 05:33

    Hi Bryn,

    It seems like you're asking to modify a YAML file in the implementation code. If that's the case, locate the "servers" attribute in the YAML file and update the "url" field with your desired URL.



    ------------------------------
    Ragavi Ramasamy
    Halleyx Inc.
    ------------------------------