corda / corda-gradle-plugins

Gradle plugins used by Corda and Cordapps
Other
24 stars 36 forks source link

dockerform task doesn't work after 4.5 + ? #396

Closed davidawad closed 3 years ago

davidawad commented 3 years ago

Thank you for choosing to report an issue with Corda.

When reporting an issue please make sure it contains;

When trying to use the dockerform plugin artemis seems to fail without much explanation. This seems to occur for various versions of corda after 4.4. I can't pin down what specifically is causing this issue.

steps to reproduce

Add the following simple dockerform config to any project in samples-java or samples-kotlin.

note that the image version doesn't seem to make a big difference it just has to match the corda properties specified.


task prepareDockerNodes(type: net.corda.plugins.Dockerform, dependsOn: ['jar']) {
dockerImage="corda/corda-zulu-java1.8-4.6"

nodeDefaults {
    projectCordapp {
        deploy = false
    }
    cordapp project(':contracts')
    cordapp project(':workflows')
}

node {
    name "O=Notary,L=London,C=GB"
    notary = [validating : false]
    p2pPort 10001
    rpcSettings {
        address("localhost:10001")
        adminAddress("localhost:10041")
    }
    sshdPort 2221
}

node {
    name "O=PartyA,L=London,C=GB"
    p2pPort 10002
    rpcSettings {
        address("localhost:10002")
        adminAddress("localhost:10042")
    }
    sshdPort 2222
    rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}

node {
    name "O=PartyB,L=New York,C=US"
    p2pPort 10003
    rpcSettings {
        address("localhost:10003")
        adminAddress("localhost:10043")
    }
    sshdPort 2223
    rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}

node {
    name "O=PartyC,L=New York,C=US"
    p2pPort 10004
    rpcSettings {
        address("localhost:10004")
        adminAddress("localhost:10044")
    }
    sshdPort 2224
    rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}

}


Then after running `./gradlew prepareDockerNodes; and docker-compose -f build/nodes/docker-compose.yml up`

I'll get the following error from docker-compose: 

partyc_1 | Advertised P2P messaging addresses : partyc:10004 partyc_1 | RPC connection address : partyc:10004 partyc_1 | RPC admin connection address : partyc:10044 partyb_1 | Advertised P2P messaging addresses : partyb:10003 partyb_1 | RPC connection address : partyb:10003 partyb_1 | RPC admin connection address : partyb:10043 partya_1 | Advertised P2P messaging addresses : partya:10002 partya_1 | RPC connection address : partya:10002 partya_1 | RPC admin connection address : partya:10042 notary_1 | Advertised P2P messaging addresses : notary:10001 notary_1 | RPC connection address : notary:10001 notary_1 | RPC admin connection address : notary:10041 partyc_1 | [ERROR] 18:51:01+0000 [main] core.server. - AMQ224000: Failure in initialisation partyc_1 | [ERROR] 18:51:01+0000 [main] rpc.ArtemisRpcBroker. - Unable to start message broker partyc_1 | Shutting down ... partyc_1 | [ERROR] 18:51:03+0000 [main] internal.NodeStartupLogging. - Failed to bind on an address in [partyc:10044, partyc:10004]. partyb_1 | [ERROR] 18:51:03+0000 [main] core.server. - AMQ224000: Failure in initialisation partyb_1 | [ERROR] 18:51:03+0000 [main] rpc.ArtemisRpcBroker. - Unable to start message broker partyb_1 | Shutting down ... partya_1 | [ERROR] 18:51:04+0000 [main] core.server. - AMQ224000: Failure in initialisation partya_1 | [ERROR] 18:51:04+0000 [main] rpc.ArtemisRpcBroker. - Unable to start message broker partya_1 | Shutting down ... partyb_1 | [ERROR] 18:51:04+0000 [main] internal.NodeStartupLogging. - Failed to bind on an address in [partyb:10043, partyb:10003]. nodes_partyc_1 exited with code 1 notary_1 | [ERROR] 18:51:05+0000 [main] core.server. - AMQ224000: Failure in initialisation notary_1 | [ERROR] 18:51:05+0000 [main] rpc.ArtemisRpcBroker. - Unable to start message broker notary_1 | Shutting down ... partya_1 | [ERROR] 18:51:05+0000 [main] internal.NodeStartupLogging. - Failed to bind on an address in [partya:10042, partya:10002]. notary_1 | [ERROR] 18:51:06+0000 [main] internal.NodeStartupLogging. - Failed to bind on an address in [notary:10041, notary:10001]. nodes_partyb_1 exited with code 1 nodes_partya_1 exited with code 1 nodes_notary_1 exited with code 1



#### To summarize

I can't get the dockerform task to work on corda 4.6. I'm not sure why artemis would be falling as code examples that have worked previously now do not. 

Please let me know if the issue is the image or if there are missing config params. 

Thanks
palade commented 3 years ago

The p2p port number and rpc port number need to be different. Cannot use the same port number.

p2pPort 10001
rpcSettings {
            address("localhost:10001")
palade commented 3 years ago

@davidawad @chrisr3 I'm closing this ticket as the proposed fix resolves the problem.