MQ

 View Only
  • 1.  MQ in a container ERR_CONNECTION_CLOSED problem

    Posted Wed March 17, 2021 11:03 AM
    Hi, I'm moving my first steps with MQ series in a container.
    I have successfully installed docker and the container as explained here Get an IBM MQ queue for development in a container, but when I restart the container or create a new one, the web console (https://localhost:9443/ibmmq/console/#/) returns ERROR_CONNECTION_CLOSED. On the log of the container I don't see any error: Netstat command responds appropriately. Docker container port <containerid> seems correct. 
    Only removing the volume qm1data and recreating the container let the console responds correctly.


    Any help could be appreciated, 

    Thanks




    ------------------------------
    Cristina Chieu
    ------------------------------


  • 2.  RE: MQ in a container ERR_CONNECTION_CLOSED problem

    Posted Thu March 18, 2021 03:02 AM
    Hello 

    what command did you issue to run your container ?
    When a container is started network used in the container is mapped to your host.
    If it is already used by another container you would not be able to map to your host.
    https://docs.docker.com/config/containers/container-networking/

    ------------------------------
    Pierre Richelle
    IBM Hybrid Cloud Integration Specialists
    IBM
    +32474681892
    ------------------------------



  • 3.  RE: MQ in a container ERR_CONNECTION_CLOSED problem

    Posted Thu March 18, 2021 04:03 AM
    Hello Pierre, 
    When I create the container I use 

    docker run --env LICENSE=accept --env MQ_QMGR_NAME=QM1 --volume qm1data:/mnt/mqm --publish 1414:1414 --publish 9443:9443 --detach --env MQ_APP_PASSWORD=passw0rd  --bind 0.0.0.0  ibmcom/mq:latest

    When the container is stopped and i restart I use 

    Docker start <container name>

    Thanks



    ------------------------------
    Cristina Chieu
    ------------------------------



  • 4.  RE: MQ in a container ERR_CONNECTION_CLOSED problem

    Posted Thu March 18, 2021 07:12 AM
    After restarting the container
    What is the output of docker ps?

    Can you open a shell with the container?
    docker exec -ti <your container id> /bin/bash
    Does dspmq state that it is running?


    ------------------------------
    Matthias Jungbauer
    ------------------------------



  • 5.  RE: MQ in a container ERR_CONNECTION_CLOSED problem

    Posted Thu March 18, 2021 07:39 AM
    Hi all, 

    the problem is the web server. 
    The only way to let the consolle starts without connection_closed error is this: 

    CRATION OF THE CONTAINER
    with the environment variable MQ_ENABLE_EMBEDDED_WEB_SERVER=0 
    sayng that I don't wat the web server enabled.

    docker run --env MQ_ENABLE_EMBEDDED_WEB_SERVER=0 --env LICENSE=accept --env MQ_QMGR_NAME=QM1 --volume qm1data:/mnt/mqm --publish 1414:1414 --publish 9443:9443 --detach --env MQ_APP_PASSWORD=passw0rd ibmcom/mq:latest

    after that i start the web server and set it up manually

    Set http host to *

    setmqweb properties -k httpHost -v '*'

     

    Start the web server

    strmqweb --clean

    In this way the consolle page responds.

    BUT

    It doesn't allow me to login anymore , defaul user admin cannot log in!!!





    ------------------------------
    Cristina Chieu
    ------------------------------



  • 6.  RE: MQ in a container ERR_CONNECTION_CLOSED problem

    Posted Fri March 19, 2021 04:57 AM
    After some strongly days the final solution was: 

    1. CRATION OF THE CONTAINER
    with the environment variable MQ_ENABLE_EMBEDDED_WEB_SERVER=0 
    sayng that I don't wat the web server enabled.

    docker run --env MQ_ENABLE_EMBEDDED_WEB_SERVER=0 --env LICENSE=accept --env MQ_QMGR_NAME=QM1 --volume qm1data:/mnt/mqm --publish 1414:1414 --publish 9443:9443 --detach --env MQ_APP_PASSWORD=passw0rd ibmcom/mq:latest

    2. Copy the file (see at the end of this post the content) 

    mqwebuser.xml

    into web server folder

    \\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\qm1data\_data\data\web\installations\Installation1\servers\mqweb

     

    3. Start the web server

    strmqweb --clean


    mqwebuser.xml content: 
    <?xml version="1.0" encoding="UTF-8"?>
    <server>
    <!--
    Licensed Materials - Property of IBM

    5724-H72

    Copyright IBM Corp. 2016, 2017 All Rights Reserved.

    US Government Users Restricted Rights - Use, duplication or
    disclosure restricted by GSA ADP Schedule Contract with
    IBM Corp.
    -->
    <!--
    Sample mqwebuser.xml file, included by server.xml, to contain user
    configuration for the mqweb server.
    -->

    <featureManager>
    <feature>appSecurity-2.0</feature>
    <feature>basicAuthenticationMQ-1.0</feature>
    </featureManager>
    <enterpriseApplication id="com.ibm.mq.console">
    <application-bnd>
    <security-role name="MQWebAdmin">
    <group name="MQWebUI" realm="defaultRealm"/>
    </security-role>
    </application-bnd>
    </enterpriseApplication>
    <enterpriseApplication id="com.ibm.mq.rest">
    <application-bnd>
    <security-role name="MQWebAdmin">
    <group name="MQWebUI" realm="defaultRealm"/>
    </security-role>
    <security-role name="MQWebUser">
    <group name="MQWebMessaging" realm="defaultRealm"/>
    </security-role>
    </application-bnd>
    </enterpriseApplication>
    <basicRegistry id="basic" realm="defaultRealm">
    <user name="admin" password="${env.MQ_ADMIN_PASSWORD}"/>
    <!-- The app user will always get a default password of "passw0rd",
    even if you don't set the environment variable.
    See `webserver.go` -->
    <user name="app" password="${env.MQ_APP_PASSWORD}"/>
    <group name="MQWebUI">
    <member name="admin"/>
    </group>
    <group name="MQWebMessaging">
    <member name="app"/>
    </group>
    </basicRegistry>
    <variable name="httpHost" value="*"/>
    </server>



    I hope to help someone else ;)

    ------------------------------
    Cristina Chieu
    ------------------------------



  • 7.  RE: MQ in a container ERR_CONNECTION_CLOSED problem

    IBM Champion
    Posted Thu March 18, 2021 04:32 AM
    Hi,

    you can connect to the command line of the container and check the WAS logs if they contain any indications about the issue.

    ------------------------------
    Hermanni Pernaa
    ------------------------------