ERROR: pull access denied for insurance-ca, repository does not exist or may require 'docker login'
Closed this issue ยท 51 comments
It seems the problem appears when building the web docker image, it may be caused by the command "apt update", which may be pulling package lists from repository that is no longer maintained.
It seems the problem appears when building the web docker image, it may be caused by the command "apt update", which may be pulling package lists from repository that is no longer maintained.
Thank you for the explanation, anyway to fix it? is it running fine with your system?
did you fix it? I am having the same issue.
did you fix it? I am having the same issue.
I coudn't yet, waiting for support!
Getting the same problem
Anybody got the solution?
The problem is most likely due to the base image in the web Dockerfile. Here is what I did:
open the Dockerfile in the web folder, modify the file as follow:
Add the following two lines at the top of the Dockerfile:
FROM ubuntu:trusty
RUN apt update && apt install -y build-essential
These two lines need to be before the original reference to base image "FROM docker.io/library/node:8.11.3"
Explanation:
It seems to me the base image points to a repository that is no longer maintained, thus the apt update got an 404 error. Thus, I add another base reference to ubuntu and move the apt update & apt install build-essential before the node base image
Then, right after the line "WORKDIR /app", modify the RUN block as follow:
RUN npm i && npm i --only=dev
&& npm run build
&& npm prune
&& apt remove -y build-essential
Save the file.
Next, open the peer-base.yaml and change the environment variable "- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=build-blockchain-insurance-app_default"
to "- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=buildblockchaininsuranceapp_default"
Save the file and run it again.
I am not sure this is the right way to do it, but at least I can bring the application up and order an insurance contract.
Hope this help
The problem is most likely due to the base image in the web Dockerfile. Here is what I did:
open the Dockerfile in the web folder, modify the file as follow:
Add the following two lines at the top of the Dockerfile:
FROM ubuntu:trusty
RUN apt update && apt install -y build-essentialThese two lines need to be before the original reference to base image "FROM docker.io/library/node:8.11.3"
Explanation:
It seems to me the base image points to a repository that is no longer maintained, thus the apt update got an 404 error. Thus, I add another base reference to ubuntu and move the apt update & apt install build-essential before the node base imageThen, right after the line "WORKDIR /app", modify the RUN block as follow:
RUN npm i && npm i --only=dev
&& npm run build
&& npm prune
&& apt remove -y build-essentialSave the file.
Next, open the peer-base.yaml and change the environment variable "- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=build-blockchain-insurance-app_default"
to "- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=buildblockchaininsuranceapp_default"Save the file and run it again.
I am not sure this is the right way to do it, but at least I can bring the application up and order an insurance contract.
Hope this help
would this also help for mac? Also, is there any need to change the peer-base.yaml if the network name is build-blockchain-insurance-app_default ? Thank you for responding,appreciate it.
For the dockerfile, since it runs in a docker container, I believe it can work for mac (I do not have mac to try it out). I have a Ubuntu 16.04 box, and the default network created removes the dash in the parent folder name, that's the reason I modify the environment variable. Check the docker network on the mac to see what you get, if network created has the same name in the environment variable, then you do not modify it.
My Dockerfile looks like this:
FROM ubuntu:trusty
RUN apt update && apt install -y build-essential
FROM docker.io/library/node:8.11.3
ENV NODE_ENV production
ENV PORT 3000
ENV DOCKER_SOCKET_PATH /host/var/run/docker.sock
ENV DOCKER_CCENV_IMAGE hyperledger/fabric-ccenv:latest
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN npm i && npm i --only=dev /
&& npm run build /
&& npm prune /
&& apt remove -y build-essential
EXPOSE 3000
CMD ["npm", "run", "serve"]
It's working in my system thanks @JosephChan101 but I skipped this step:
open the peer-base.yaml and change the environment variable "- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=build-blockchain-insurance-app_default"
to "- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=buildblockchaininsuranceapp_default"
because it was giving some sort of npm error:
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! blockchain-for-insurance@2.1.1 serve: cross-env NODE_ENV=production&&node ./bin/server
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the blockchain-for-insurance@2.1.1 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
did you fix it? I am having the same issue.
Did You make the same changes as mentioned by @JosephChan101 to get it running?
did you fix it? I am having the same issue.
Did You make the same changes as mentioned by @JosephChan101 to get it running?
yes I excluded a step...mentioned above in the comment
After playing with the dockerfile in the web folder a few more times, I found that the build-essential may not be necessary. I made some adjustment to the dockerfile and found it worked.
The new dockerfile I use:
FROM docker.io/library/node:8.11.3
ENV NODE_ENV production
ENV PORT 3000
ENV DOCKER_SOCKET_PATH /host/var/run/docker.sock
ENV DOCKER_CCENV_IMAGE hyperledger/fabric-ccenv:latest
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN npm i && npm i --only=dev
&& npm run build
&& npm prune
EXPOSE 3000
CMD ["npm", "run", "serve"]
It is just the same as the original one except I remove the "apt update && apt install -y build-essential" and "apt remove -y build-essential" from the RUN command.
This should be better than the workaround I suggested before since this would not pull the ubuntu image, which is huge.
After playing with the dockerfile in the web folder a few more times, I found that the build-essential may not be necessary. I made some adjustment to the dockerfile and found it worked.
The new dockerfile I use:
FROM docker.io/library/node:8.11.3
ENV NODE_ENV production
ENV PORT 3000
ENV DOCKER_SOCKET_PATH /host/var/run/docker.sock
ENV DOCKER_CCENV_IMAGE hyperledger/fabric-ccenv:latestRUN mkdir /app
COPY . /app
WORKDIR /appRUN npm i && npm i --only=dev
&& npm run build
&& npm pruneEXPOSE 3000
CMD ["npm", "run", "serve"]It is just the same as the original one except I remove the "apt update && apt install -y build-essential" and "apt remove -y build-essential" from the RUN command.
This should be better than the workaround I suggested before since this would not pull the ubuntu image, which is huge.
This is how my docker file looks, do u think its fine, I am still getting the same error, Do i need to make any more changes?
Can you show me the error message? Are you using a mac? Mine is an Ubuntu 16.04 computer.
Can you show me the error message? Are you using a mac? Mine is an Ubuntu 16.04 comput
-
I tried on mac,but hasnt worked yet.
-
a) I am using ubuntu 18.10
b)node version - v10.14.2
c)docker version - 18.09.3
d) docker compose -1.23.2
e)Python version - 3.6.7 -
I had tried running the app before the latest commit, it worked using the 2nd last commit(d9de332) then.
-
After that i tried rebuilding and i had #68 and after following your changes @JosephChan101 I am getting the error above.
-
Below mentioned is my docker file:
FROM docker.io/library/node:8.11.3
ENV NODE_ENV production
ENV PORT 3000
ENV DOCKER_SOCKET_PATH /host/var/run/docker.sock
ENV DOCKER_CCENV_IMAGE hyperledger/fabric-ccenv:latest
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN npm i && npm i --only=dev
&& npm run build
&& npm prune
EXPOSE 3000
CMD ["npm", "run", "serve"]
Thanks for the Support.
It seems to me the dockerfile works as expected and the web image is built on your system. Your error occurs during the instantiation of the chaincode. Notice that you have node v10 installed on your system, but fabric only supports node v8.X.X. This may cause the error. Also, if you have time to run the app again, please check the docker network using the "docker network ls" and show me the output. I want see whether the network created has the same name in the environment variable.
Regarding the node version, @hovig mentioned in #62, that all the latest versions are required, and had tried on mac with all the latest versions, it worked, but i ll still try using node 8.X.X.
- Here is the o/p
/build-blockchain-insurance-app$ docker network ls
NETWORK ID NAME DRIVER SCOPE
b3c6a6ddcfc8 bridge bridge local
307f6adc5d78 build-blockchain-insurance-app_default bridge local
8795047e7cb1 host host local
2b13574822ec none null local
and here is the config in the peer-base.yaml file
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=build-blockchain-insurance-app_default
Also
&& npm i && npm i --only=dev
&& npm run build
&& npm prune
are the * \ * before every && to be put cuz I coudnt find them in your msg @JosephChan101 and are there in the original file.
So the problem is not caused by the environment variable. From your screen captured above, there is a REQUEST_TIMEOUT error which occurs at util.js line 243. But I have no idea what causes the request timeout.
After poking around a few places, I believe this error happens when insurance-peer tries to instantiate the chaincode. Would you please try "docker logs insurance-peer" to see what's going on with insurance-peer?
\ is the line connector and you need it except for the last line, in this case don't put it after "&& npm prune".
I did not have it in my previous message because I just copy and place the dockerfile, and forgot to escape the \ character, therefore it did not show.
After poking around a few places, I believe this error happens when insurance-peer tries to instantiate the chaincode. Would you please try "docker logs insurance-peer" to see what's going on with insurance-peer?
Here is the log O/p.
Have you tried node v8 yet? Your log file seems OK too me, insurance-peer can process proposals normally.
I compared your log file to mine and found that they are the same up to INFO 45, which is a step building chaincode. However, after that yours is different, there is an error message:
INFO 046 streaming call completed grpc.service=protos.Deliver grpc.method=Deliver grpc.peer_address=172.20.0.11:42916 error="context finished before block retrieved: context canceled" grpc.code=Unknown grpc.call_duration=1m6.546177751s
After that your peer keeps calling chaincode procedures but seems nothing is done. Sorry I don't know what to do yet at this moment.
Here is my log file:
joe_log.txt
Are you using a VM for this on your Mac?
I compared your log file to mine and found that they are the same up to INFO 45, which is a step building chaincode. However, after that yours is different, there is an error message:
INFO 046 streaming call completed grpc.service=protos.Deliver grpc.method=Deliver grpc.peer_address=172.20.0.11:42916 error="context finished before block retrieved: context canceled" grpc.code=Unknown grpc.call_duration=1m6.546177751sAfter that your peer keeps calling chaincode procedures but seems nothing is done. Sorry I don't know what to do yet at this moment.
Here is my log file:
joe_log.txtAre you using a VM for this on your Mac?
on mac this doesnt get built I have the #68 error, I have an other system which has linux and in that it got built but isnt functioning. No worries, Thanks for the help, I might also try using node V8.
@sblisztomaniac - i was running into the same problem as your self - but I got past it by updating ma couple of things in the Docker file 1) use node 8.9.0 . 2) changing the RUN npm. This is what my Dockerfile looks like:
`FROM docker.io/library/node:8.9.0
ENV NODE_ENV production
ENV PORT 3000
ENV DOCKER_SOCKET_PATH /host/var/run/docker.sock
ENV DOCKER_CCENV_IMAGE hyperledger/fabric-ccenv:latest
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN npm i && npm i --only=dev && npm run build && npm prune
EXPOSE 3000
CMD ["npm", "run", "serve"]`
I got similar issue. The above is the screenshot of my insurance-peer logs.
Can you give me a solution ?
Thank you!
From your screen shot I saw the first error sign occurs at step 025 (the warning message in yellow), which is a warning of channel doesn't exist. Most likely is due to the insurance-peer not joining the channel. When you brought up the network, did you see the four messages of "peer joining the channel"? There should be four for insurance-peer, shop-peer, repairshop-peer, and police-peer.
Got it. Issue fixed. It runs now. Thank you very much!
โฆ
On Thu, Apr 4, 2019 at 12:16 PM JosephChan101 @.***> wrote: [image: a] https://user-images.githubusercontent.com/48857760/55528413-5a46b580-56ba-11e9-99db-1e3cfd872843.png I got similar issue. The above is the screenshot of my insurance-peer logs. Can you give me a solution ? Thank you! From your screen shot I saw the first error sign occurs at step 025 (the warning message in yellow), which is a warning of channel doesn't exist. Most likely is due to the insurance-peer not joining the channel. When you brought up the network, did you see the four messages of "peer joining the channel"? There should be four for insurance-peer, shop-peer, repairshop-peer, and police-peer. โ You are receiving this because you commented. Reply to this email directly, view it on GitHub <#68 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AumCoIGw9oWF8lyaTAQQ1iVSx7FD_Ddqks5vdZ_igaJpZM4cPai0 .
What changes did you make exactly?
I had still the same issue today. Fixed it by changing to node:8.11-stretch
Found the issue with the jessie repository to be on their end if I am not mistaken
I had still the same issue today. Fixed it by changing to node:8.11-stretch
Found the issue with the jessie repository to be on their end if I am not mistaken
I could verify in the installation process on another machine repeat and successfully pulled the image producing the error above after changing the base image in the first line of the web container docker image (web/Dockerfile
) to
node:8.11-stretch
For us this solves the mentioned error successfully.
I had follow the instructions, but I have trouble with permission when run ./build_ubuntu.sh. Any one can help me ! !
I would love to help you but you don't give enough information about which instructions you followed and at what step exactly it fails. Looks like a different issue than the one referenced above to me.
The problem is most likely caused by the code "apt update && apt install -y build-essential" the dockerfile in /web folder. Open the dockerfile and change the RUN block as follow:
RUN npm i && npm i --only=dev \
&& npm run build \
&& npm prune \
Save it and try run the build_ubuntu.sh again to see whether it works
Joseph
I had follow the instructions, but I have trouble with permission when run ./build_ubuntu.sh. Any one can help me ! !
I would love to help you but you don't give enough information about which instructions you followed and at what step exactly it fails. Looks like a different issue than the one referenced above to me.
i tried some solution from this discussion for my problem,
The problem is most likely caused by the code "apt update && apt install -y build-essential" the dockerfile in /web folder. Open the dockerfile and change the RUN block as follow:
RUN npm i && npm i --only=dev
&& npm run build
&& npm prune \Save it and try run the build_ubuntu.sh again to see whether it works
Joseph
I had follow your solution, but still had error. This the error code :
.........
Step 9/11 : RUN npm i && npm i --only=dev && npm run build && npm prune
---> Running in da7f7de35cb8
fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES: permission denied, open '/usr/local/lib/node_modules/npm/bin/npm-cli.js'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at Object.Module._extensions..js (module.js:662:20)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
The command '/bin/sh -c npm i && npm i --only=dev && npm run build && npm prune' returned a non-zero code: 1
Pulling insurance-ca (insurance-ca:)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.
Continue with the new image? [yN]y
Pulling insurance-ca (insurance-ca:)...
ERROR: pull access denied for insurance-ca, repository does not exist or may require 'docker login'
@kuliahjogja can you confirm that you tried my solution not successfully?
I could verify in the installation process on another machine repeat and successfully pulled the image > producing the error above after changing the base image in the first line of the web container docker > image (web/Dockerfile) to
node:8.11-stretch
For us this solves the mentioned error successfully.
This and only this solved the initial problem given here for me and peers.
@kuliahjogja can you confirm that you tried my solution not successfully?
I could verify in the installation process on another machine repeat and successfully pulled the image > producing the error above after changing the base image in the first line of the web container docker > image (web/Dockerfile) to
node:8.11-stretch
For us this solves the mentioned error successfully.This and only this solved the initial problem given here for me and peers.
i have tried to reinstall docker, docker-composer, and node 8.11.3 thats compatible version with this hyperledger and It's work. Thanks you for all
Hey @sblisztomaniac I was getting the same error as you mentioned in #68 (comment) but it's resolved now . Finally whosoever comes to this thread, here are the changes you need to make and thanks to @JosephChan101 for bearing so much and helping us out.
Two files need to be modified. Make sure your files look like the ones below.
- build-blockchain-insuarance-app/web/Dockerfile
FROM docker.io/library/node:8.9.0
ENV NODE_ENV production
ENV PORT 3000
ENV DOCKER_SOCKET_PATH /host/var/run/docker.sock
ENV DOCKER_CCENV_IMAGE hyperledger/fabric-ccenv:latest
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN npm i && npm i --only=dev
&& npm run build
&& npm prune
EXPOSE 3000
CMD ["npm", "run", "serve"]
- build-blockchain-insuarance-app/peer-base.yaml
version: '2'
services:
peer-base:
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=buildblockchaininsuranceapp
_default
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_ENDORSER_ENABLED=true
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_MSPCONFIGPATH=/peer/crypto/msp
- CORE_PEER_TLS_CERT_FILE=/peer/crypto/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/peer/crypto/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/peer/crypto/tls/ca.crt
working_dir: /peer
command: peer node start
volumes:
- /var/run/:/host/var/run/
Note that in second file the value of CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE
has been altered, to be specific the dashes have been removed else you'll get a 404 error.
That's all. This would work probably. I recommend you to start afresh and thus remove all the containers formed due to previous runnings of the build. In a nutshell follow the below steps and you'll be good to go.
Make sure you've made the necessary changes to the files mentioned above.
Run the commands below once you get into the dir where build_ubuntu.sh resides.
docker stop $(docker ps -aq) && docker rm $(docker ps -aq)
docker login
./build_ubuntu.sh
docker logs web
You'll notice the chaincode has been successfully instantiated.
Also refer #79 for more reference.
@sblisztomaniac - this pattern has been upgraded to use the IBM Blockchain Platform - please try version.
@DeepRoy683
i have the same docker file and peer-base.yaml like you but i have some error
docker file
FROM ubuntu:trusty
RUN apt update && apt install -y build-essential
FROM docker.io/library/node:8.11.3
ENV NODE_ENV production
ENV PORT 3000
ENV DOCKER_SOCKET_PATH /host/var/run/docker.sock
ENV DOCKER_CCENV_IMAGE hyperledger/fabric-ccenv:latest
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN npm i && npm i --only=dev
&& npm run build
&& npm prune
&& apt remove -y build-essential
EXPOSE 3000
CMD ["npm", "run", "serve"]
peer-base.yaml
version: '2'
services:
peer-base:
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=build-blockchain-insurance-app_default
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_ENDORSER_ENABLED=true
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_MSPCONFIGPATH=/peer/crypto/msp
- CORE_PEER_TLS_CERT_FILE=/peer/crypto/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/peer/crypto/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/peer/crypto/tls/ca.crt
working_dir: /peer
command: peer node start
volumes:
- /var/run/:/host/var/run/
ERROR:
blockchain-for-insurance@2.1.1 serve /app
cross-env NODE_ENV=production&&node ./bin/server
Wallet path: /app/www/blockchain/wallet
/app/app/static/js
Server running on port: 3000
Default channel not found, attempting creation...
Successfully created a new default channel.
Joining peers to the default channel.
Peer joined default channel
Peer joined default channel
Peer joined default channel
Peer joined default channel
Connecting and Registering Block Events
Chaincode is not installed, attempting installation...
Please how can i rebuild this project
i want to rebuild a new project like tihs
@DeepRoy683 @JosephChan101 @shalmali86 @ljbennett62
Follow this and make sure you are in the correct directory. Refer ending part of this comment #68 (comment)
docker stop
$(docker ps -aq) && docker rm $ (docker ps -aq)
docker login
./build_ubuntu.sh
docker logs web // wait for couple of minutes after the build completes and then run docker logs web
i want want to make my own insurance blockchain platform like this
how can i do this?
@vaibhavr2709 - why don't you start with the code base from this repo by cloning it and then build upon it?
In my case the base image name was incorrect in the Dockerfile. Always check the base image details in the docker hub first and preferably copy and paste then into FROM command of Dockerfile
thanks
do you know a forum where we can chat about blockchain only?