Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start a service deployed using the command deploy #1022

Closed
NicolasMahe opened this issue Jun 4, 2019 · 2 comments · Fixed by #1023
Closed

Cannot start a service deployed using the command deploy #1022

NicolasMahe opened this issue Jun 4, 2019 · 2 comments · Fixed by #1023
Assignees

Comments

@NicolasMahe
Copy link
Member

Related to mesg-foundation/cli#32 and #1014

I got a weird error when I want to start a service deployed with this new command:

➜  cli git:(feature/new-deploy) ./bin/run service:start CfXKjFHwNo8GXyyg5qpEWaHzb6ec27NCma52k1hgUEBw
Start service... !
Error: 2 UNKNOWN: Error response from daemon: rpc error: code = InvalidArgument desc = name must be valid as a DNS name component
    at Object.exports.createStatusError (~/Developments/MESG/cli/node_modules/grpc/src/common.js:91:15)
    at Object.onReceiveStatus (~/Developments/MESG/cli/node_modules/grpc/src/client_interceptors.js:1204:28)
    at InterceptingListener._callNext (~/Developments/MESG/cli/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (~/Developments/MESG/cli/node_modules/grpc/src/client_interceptors.js:618:8)
    at callback (~/Developments/MESG/cli/node_modules/grpc/src/client_interceptors.js:845:24)

I previously executed the command:

./bin/run service:newdeploy "$(./bin/run service:compile ../services/service-ethereum)"

It returned:

Deploy service... com.mesg.ethereum (CfXKjFHwNo8GXyyg5qpEWaHzb6ec27NCma52k1hgUEBw)

The command service list of the Go cli show this service:

➜  ~ mesg-core service list
HASH                                            SID                  NAME               STATUS     
CfXKjFHwNo8GXyyg5qpEWaHzb6ec27NCma52k1hgUEBw    com.mesg.ethereum    Ethereum           stopped    
3CaMQXGGRZbhrTX1uk3yTwcyBEja4nHbNuxSuuW2tug6    marketplace          Marketplace        running    
DUKu7QydSpbSQXxch3ZNrJYWXMigh3iwC9EnNgQeRmjw    ethwallet            Ethereum Wallet    running  
@NicolasMahe
Copy link
Member Author

The command service:detail returns a correct service definition:

cli git:(feature/new-deploy) ./bin/run service:detail CfXKjFHwNo8GXyyg5qpEWaHzb6ec27NCma52k1hgUEBw
[
  {
    "status": 1,
    "definition": {
      "name": "Ethereum",
      "description": "Ethereum Service to interact with any Smart Contract",
      "tasks": [
        {
          "name": "Execute a Smart Contract Method",
          "description": "This task executes a method on any Smart Contract",
          "inputs": [
            {
              "name": "Method ABI",
              "description": "The ABI of the method to execute. Only pass the ABI of the method and NOT all the Smart Contract's ABI.",
              "type": "Any",
              "key": "methodAbi"
            },
            {
              "name": "Inputs",
              "description": "The inputs to use during the execution of the method. Pass an Object with parameter's name as key and parameter's value as value.",
              "type": "Any",
              "key": "inputs"
            },
            {
              "name": "Contract address",
              "description": "The address of the contract",
              "type": "String",
              "key": "contractAddress"
            },
            {
              "name": "Signer private key",
              "description": "The private key to sign the transaction",
              "type": "String",
              "key": "privateKey"
            },
            {
              "type": "String",
              "optional": true,
              "key": "value"
            },
            {
              "name": "Gas Price",
              "description": "The gas price in wei to use for this transaction",
              "type": "String",
              "optional": true,
              "key": "gasPrice"
            },
            {
              "name": "Gas Limit",
              "description": "The maximum gas provided for this transaction",
              "type": "Number",
              "optional": true,
              "key": "gas"
            }
          ],
          "outputs": [
            {
              "name": "Success",
              "description": "Output when the task executes successfully"
            },
            {
              "name": "Error",
              "description": "Output when an error occurs"
            }
          ],
          "key": "executeSmartContractMethod"
        },
        {
          "name": "Call a Smart Contract Method",
          "description": "This task call a 'constant' method on any Smart Contract. It does not require fees.",
          "inputs": [
            {
              "name": "Method ABI",
              "description": "The ABI of the method to execute. Only pass the ABI of the method and NOT all the Smart Contract's ABI.",
              "type": "Any",
              "key": "methodAbi"
            },
            {
              "name": "Inputs",
              "description": "The inputs to use during the execution of the method. Pass an Object with parameter's name as key and parameter's value as value.",
              "type": "Any",
              "key": "inputs"
            },
            {
              "name": "Contract address",
              "description": "The address of the contract",
              "type": "String",
              "key": "contractAddress"
            }
          ],
          "outputs": [
            {
              "name": "Success",
              "description": "Output when the task executes successfully"
            },
            {
              "name": "Error",
              "description": "Output when an error occurs"
            }
          ],
          "key": "callSmartContractMethod"
        },
        {
          "inputs": [
            {
              "type": "Any",
              "key": "abi"
            },
            {
              "type": "String",
              "key": "address"
            },
            {
              "type": "String",
              "key": "data"
            },
            {
              "type": "Any",
              "key": "topics"
            },
            {
              "type": "Number",
              "key": "logIndex"
            },
            {
              "type": "String",
              "key": "transactionHash"
            },
            {
              "type": "Number",
              "key": "transactionIndex"
            },
            {
              "type": "String",
              "key": "blockHash"
            },
            {
              "type": "Number",
              "key": "blockNumber"
            }
          ],
          "outputs": [
            {},
            {
              "name": "Error",
              "description": "Output when an error occurs"
            }
          ],
          "key": "decodeLog"
        }
      ],
      "events": [
        {
          "data": [
            {
              "type": "String",
              "key": "address"
            },
            {
              "type": "String",
              "key": "data"
            },
            {
              "type": "Any",
              "key": "topics"
            },
            {
              "type": "Number",
              "key": "logIndex"
            },
            {
              "type": "String",
              "key": "transactionHash"
            },
            {
              "type": "Number",
              "key": "transactionIndex"
            },
            {
              "type": "String",
              "key": "blockHash"
            },
            {
              "type": "Number",
              "key": "blockNumber"
            }
          ],
          "key": "log"
        },
        {
          "data": [
            {
              "type": "Number",
              "key": "number"
            },
            {
              "type": "String",
              "key": "hash"
            },
            {
              "type": "String",
              "key": "parentHash"
            },
            {
              "type": "String",
              "key": "sha3Uncles"
            },
            {
              "type": "String",
              "key": "logsBloom"
            },
            {
              "type": "String",
              "key": "stateRoot"
            },
            {
              "type": "String",
              "key": "miner"
            },
            {
              "type": "String",
              "key": "extraData"
            },
            {
              "type": "Number",
              "key": "gasLimit"
            },
            {
              "type": "Number",
              "key": "gasUsed"
            },
            {
              "type": "Number",
              "key": "timestamp"
            },
            {
              "type": "Number",
              "key": "size"
            },
            {
              "type": "String",
              "key": "difficulty"
            }
          ],
          "key": "block"
        },
        {
          "data": [
            {
              "type": "String",
              "key": "transactionHash"
            },
            {
              "type": "Number",
              "key": "transactionIndex"
            },
            {
              "type": "String",
              "key": "blockHash"
            },
            {
              "type": "Number",
              "key": "blockNumber"
            },
            {
              "type": "String",
              "key": "from"
            },
            {
              "type": "String",
              "optional": true,
              "key": "to"
            },
            {
              "type": "Boolean",
              "key": "status"
            },
            {
              "type": "String",
              "key": "value"
            },
            {
              "type": "String",
              "key": "gasPrice"
            },
            {
              "type": "Number",
              "key": "gas"
            },
            {
              "type": "Number",
              "key": "gasUsed"
            },
            {
              "type": "String",
              "key": "input"
            },
            {
              "type": "String",
              "optional": true,
              "key": "contractAddress"
            },
            {
              "type": "Number",
              "key": "cumulativeGasUsed"
            },
            {
              "type": "Object",
              "optional": true,
              "key": "logs",
              "repeated": true,
              "object": [
                {
                  "type": "String",
                  "key": "address"
                },
                {
                  "type": "String",
                  "key": "data"
                },
                {
                  "type": "String",
                  "key": "topics",
                  "repeated": true
                },
                {
                  "type": "Number",
                  "key": "logIndex"
                },
                {
                  "type": "String",
                  "key": "transactionHash"
                },
                {
                  "type": "Number",
                  "key": "transactionIndex"
                },
                {
                  "type": "String",
                  "optional": true,
                  "key": "blockHash"
                },
                {
                  "type": "Number",
                  "key": "blockNumber"
                }
              ]
            }
          ],
          "key": "transaction"
        }
      ],
      "configuration": {},
      "hash": "CfXKjFHwNo8GXyyg5qpEWaHzb6ec27NCma52k1hgUEBw",
      "sid": "com.mesg.ethereum"
    }
  }
]

@ilgooz
Copy link
Contributor

ilgooz commented Jun 4, 2019

@NicolasMahe I've locally fixed this but didn't create a PR for now since service:start is meant to be used with service:deploy. I'm experimenting with new deploy & start commands and I'll create some fix PRs to complete missing parts of new deploy afterwards.

This issue is related to missing "service" key on service definition's Configuration. It also misses holding the default env vars given by the compile command.

@ilgooz ilgooz self-assigned this Jun 4, 2019
@ilgooz ilgooz transferred this issue from mesg-foundation/cli Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants