dappnode / DAppNodeSDK

dappnodesdk is a tool to mantain dappnode packages. It helps to initialize and publish an Aragon Package Manager Repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot set property 'image' of undefined when service name is different from package name.

zguesmi opened this issue · comments

When the service name in docker-compose.yml is different from the package name in dappnode_package.json, the command

dappnodesdk build

fails with the error:

TypeError: Cannot set property 'image' of undefined

logs:

  ✔ Create release dir
  ✔ Copy files and validate
  ✖ Build docker image
    → Cannot set property 'image' of undefined
    Save and compress image
    Upload release to IPFS
    Save upload results
TypeError: Cannot set property 'image' of undefined
    at Object.updateCompose (/home/zied/dotfiles/nvm/.config/nvm/versions/node/v10.20.1/lib/node_modules/@dappnode/dappnodesdk/dist/utils/compose.js:151:34)
    at Object.<anonymous> (/home/zied/dotfiles/nvm/.config/nvm/versions/node/v10.20.1/lib/node_modules/@dappnode/dappnodesdk/dist/tasks/buildAndUpload.js:113:27)
    at Generator.next (<anonymous>)
    at /home/zied/dotfiles/nvm/.config/nvm/versions/node/v10.20.1/lib/node_modules/@dappnode/dappnodesdk/dist/tasks/buildAndUpload.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/zied/dotfiles/nvm/.config/nvm/versions/node/v10.20.1/lib/node_modules/@dappnode/dappnodesdk/dist/tasks/buildAndUpload.js:4:12)
    at Task.task (/home/zied/dotfiles/nvm/.config/nvm/versions/node/v10.20.1/lib/node_modules/@dappnode/dappnodesdk/dist/tasks/buildAndUpload.js:111:32)
    at Promise.resolve.then.then.skipped (/home/zied/dotfiles/nvm/.config/nvm/versions/node/v10.20.1/lib/node_modules/@dappnode/dappnodesdk/node_modules/listr/lib/task.js:167:30)
    at process._tickCallback (internal/process/next_tick.js:68:7)

How to reproduce:

Create a fresh Dappnode package and change the name of the service in the docker-compose file.

How to fix:

Should check compose.services[name] before accessing the field image here.