ask init error: unable to get local issuer certificate - cmd

I am trying to initialize the ask cli using ask init on my git bash command line but it keeps throwing an error
I tried adding credentials to my env variables
i am using windows so the steps are
npm install -g --production windows-build-tools
npm install -g ask-cli
ask init
expect to ask for creds
got:
This command will initialize the ASK CLI with a profile associated with your Amazon developer credentials.
------------------------- Step 1 of 2 : ASK CLI Initialization -------------------------
Switch to "Login with Amazon" page and sign-in with your Amazon developer credentials.
If your browser did not open the page, run the initialization process again with command "ask init --no-browser".
[Error]: Cannot obtain access token. Error: unable to get local issuer certificate

Related

Why do I always `unauthorized: authentication required` when using bash to connect to Azure Container Registry?

I'm writing a simple bash script to pull an image from Azure Container Registry. If I type the command on the shell, I get authenticated and the images are pulled without any issue. However, when I run the same commands using the bash script, I get the unauthorized error.
Script
#!/bin/sh
sudo service docker start
docker logout
az logout
docker login myregistry.azurecr.io
sudo docker pull myregistry.azurecr.io/rstudio-server:0.1
Error
Error response from daemon: Get "https://myregistry.azurecr.io/v2/": unauthorized: aad access token with sp failed client id must be guid
Error response from daemon: Head "https://myregistry.azurecr.io/v2/rstudio-server/manifests/0.1": unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.
I don't understand why it's happening even when I'm logged in.
Tested in my environment working fine for me.
Make sure Your password will be stored unencrypted in /root/.docker/config.json if not try to authenticate it manually by providing username and password in bash script.
sudo service docker start
docker logout
az logout
docker login myregistry.azurecr.io --username $SP_APP_ID --password $SP_PASSWD
sudo docker pull myregistry.azurecr.io/rstudio-server:0.1
You can also use the username and password of ACR as prvided in below picture inplace of APP_ID and SP_PASSWD
Would Suggest you to please follow this Microsoft Document for more information about authentication of ACR from Docker

Trying to do heroku login or netlify login in git bash, getting this error "Error: unable to verify the first certificate"

$ heroku login
heroku: Press any key to open up the browser to login or q to exit:
Error: unable to verify the first certificate
$ netlify login
Logging into your Netlify account...
» FetchError: request to https://api.netlify.com/api/v1/oauth/tickets?client_id=d6f37de6614df7ae58664cfca524744d73807a377f5ee71f1a254f78412e3750 failed, reason: unable to verify the first certificate
I was able to solve my problem by just renewing my antivirus.It actually needed a valid and trusted server certificate which was issued by the antivirus itself.

Creation of authentication connection is failing

I am following the virtual assistant get started sample:
Virtual asistant
I am stuck on the step "Skill Authentication".
I tried to use the following command with all the arguments and generated botsecret for --secret argument.
msbot connect generic --name "Authentication" --keys "{\"YOUR_AUTH_CONNECTION_NAME\":\"Azure Active Directory v2\"}" --bot YOURBOTFILE.bot --secret "YOUR_BOT_SECRET" --url "portal.azure.net"
I still get the following error:
Error: You are attempting to perform an operation which needs access to the secret and --secret is missing
Can someone tell me what am I missing?

How do I resolve the following issue on hyperledger composer cli command for identity issue?

image 1 image 2
From the following link
https://hyperledger.github.io/composer/reference/composer.identity.issue.html
composer identity issue -c admin#mron-business-network -fsupplier -u suppid -a "resource:org.mron.Supplier#S001" -x false
Issue identity and create Network Card for: suppid
✖ Issuing identity. This may take a few seconds...
Error: fabric-ca request register failed with errors [[{"code":400,"message":"Authorization failure"}]]
Command failed
same message posted on Rocketchat earlier. It would appear that the admin id in your card is not the one currently known to the CA server. After import using (for example) composer card import -f <filename>, you need to connect to the business network (or use composer network ping -c admin#mron-business-network to connect) - for the credentials (key/certificate) to be downloaded to the wallet from the CA server. You can then verify this with a composer card list --name admin#mron-business-network and see the 'Credentials set' message for the card in question.

[Error: EACCES: permission denied, open '/home/ubuntu/.hfc-key-store/

I am getting following error while running composer rest server. I am using aws ubuntu 16.04 server.
Hyperledger Composer
? Enter your Fabric Connection Profile Name: hlfv1
? Enter your Business Network Identifier : digitalproperty-network
? Enter your Fabric username : admin
? Enter your secret: Xurw3yU9zI0l
? Specify if you want namespaces in the generated REST API: never use namespaces
? Specify if you want the generated REST API to be secured: No
To restart the REST server using the same options, issue the following command:
composer-rest-server -p hlfv1 -n digitalproperty-network -i admin -s Xurw3yU9zI0l -N never
Discovering types from business network definition ...
Connection fails: Error: error trying login and get user Context.
Error: error trying to enroll user. Error: Failed to generate key for
enrollment due to error [Error: EACCES: permission denied, open
'/home/ubuntu/.hfc-key-store/be8405cef82cc00455de296664ccdcb35e4c707bb0e63a00d0bef76546528e13-priv']
It will be retried for the next request. Error: error trying login and
get user Context. Error: error trying to enroll user. Error: Failed to
generate key for enrollment due to error [Error: EACCES: permission
denied, open
'/home/ubuntu/.hfc-key-store/be8405cef82cc00455de296664ccdcb35e4c707bb0e63a00d0bef76546528e13-priv']
at client.getUserContext.then.then.catch (/home/ubuntu/.nvm/versions/node/v6.11.0/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:293:34)
ubuntu#ip-172-31-19-220:~/composer-sample-networks/packages/digitalproperty-network$
when connecting to the running v1.0 Fabric dev environment using hlfv1 or running the REST server (as shown above) - you need to provide the default admin password of 'adminpw' - please try running composer-rest-server again and use the correct password. cheers Paul
On the similar set up, I could able to work with following command, basically use PeerAdmin user instead of admin. For example:
composer-rest-server -p hlfv1 -n my-network -i PeerAdmin -s PeerAdmin -N never
If you still face same issue, try with sudo

Resources