NEAR dev-deploy fails with Error: Can not sign transactions no matching key pair found - nearprotocol

Using a freshly created create-near-app I am trying to dev-deploy and getting this error:
Starting deployment. Account id: dev-1635099366550-3101206, node: https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file: out/main.wasm
An error occured
Error: Can not sign transactions for account dev-1635099366550-3101206 on network testnet, no matching key pair found in InMemorySigner(MergeKeyStore(UnencryptedFileSystemKeyStore(/Users/<username>/.near-credentials), UnencryptedFileSystemKeyStore(/Users/<username>/Documents/Projects/new_test_app/neardev))).
I'm unsure what's causing it or what needs to be done to resolve it. I've checked the /Users/<username>/.near-credentials credentials directory and there is a .json file containing credentials. I tried near clean & rebuilding, ensured I had done near login even tried with sudo thinking it might be a permissions error.

I don't have a reason for the "why" behind this happening, but eventually I tried deleting the dev-1635099366550-3101206.json file in /Users/<username>/.near-credentials (the first dev account it created) and then re-ran near dev-deploy.
This created a new dev account and seemed to work fine. Re-running near dev-deploy after that also seemed to work fine, redeploying the contract to the same account.

I got the same problem and I tried to open the web on another web browser, the problem disappeared.
[UPDATE]
I clean the browser local storage and import the wallet again, everything works fine.

Use NEAR connected account interface instead.
You can read more at here : https://near.github.io/near-api-js/classes/walletaccount.connectedwalletaccount.html

Related

recaptcha enterprise BROWSER_ERROR

I am trying to use recaptcha enterprise. I got the necessary key in the console, I registered the domain (and even tried turning off domain verification). Everything works well for me on localhost, but when I check on the server, I get the following error:
'java.lang.RuntimeException: The CreateAssessment call failed because the token was: BROWSER_ERROR (of class java.lang.RuntimeException)'.
Can you give me some pointers on where to start and where to look. Thanks!
created a new key in the console and everything worked on the destination domain

Error getting Home Graph: sync error: 403: Please make sure you have resourcemanager.projects.get permission in Google Smart Home Action Test Suite

I have completed all the procedures in the development process of the Google Smart Home action including Invocation, Actions, and Account linking.
However when I try to test the same, If I go to test suit and log in with my developer mail id and paste my action's project id, It throws an error:
Error getting Home Graph: sync error: 403: Please make sure you have resourcemanager.projects.get permission on project 'project-id'
My bad, it was a more sort of invisible typo error.
I am not sure why, but when we copy the project ID from google action's console there is a space prefixed with the project id. Which causes this issue.
Make sure to remove extra whitespaces on both sides of the project ID and try again in the test suit.

Google Sheets API Java program, works on one machine and not the other - 401 Au

I've got a working basic Java App that uploads some data to a google sheets file of mine.
I uploaded it to a git client, pulled it to my other computer, and it doesn't work on that with a 401
Exception in thread "main" com.google.api.client.auth.oauth2.TokenResponseException: 401 Unauthorized
at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105)
at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287)
at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307)
at com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:570)
at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489)
at com.google.api.client.auth.oauth2.Credential.intercept(Credential.java:217)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:868)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at App.main(App.java:71)
Any idea what could be different between the two machines? I understand it that if I'm using the same client_secret.json, it should be irrelevant which machine I'm on?
UDPATE 1:
ok, some extra info - i just tried my project at work on my work laptop and it worked fine! On first run it opened a browser window and asked me which google account I wanted to use, I chose the correct one, and that worked. On the laptop I have that didn't work, I wasn't given that option (that I remember) so how can I reset the google account that has been used to authenticate against?
I saw this in my cmd line
Please open the following address in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=blah-notputtingmyrealid.apps.googleusercontent.com&redirect_uri=http://localhost:42299/Callback&response_type=code&scope=https://www.googleapis.com/auth/spreadsheets
Attempting to open that address in the default browser now...
Since it's working on your previous computer, the issue might be concerning the location of your client_secret.json. If you check the Java Quickstart setup, there's a part where you need to download the JSON file and place it on your working directory. Since, you're on a new machine, that file is now missing.
g. Click the file_download (Download JSON) button to the right of the
client ID.
h. Move this file to your working directory and rename it
client_secret.json.
Or the access token has expired.

FAILED_PRECONDITION when trying to create a new Google API project

I am getting an error when attempting to create a new project for Google API at https://code.google.com/apis/console
I was hoping the error was temporary, but I have been unable to create a new project for a couple weeks now.
The error seems to have changed, as it used to include server ip information and a lot of other data. An example with some potentially private information removed:
APPLICATION_ERROR;google.cloudresourcemanager.projects.v1beta1/DeveloperProjects.CreateProject;com.google.apps.framework.request.StatusException:
generic::FAILED_PRECONDITION:
;AppErrorCode=9;StartTimeMs=1489595147198;tcp;Deadline(sec)=50.0;ResFormat=UNCOMPRESSED;ServerTimeSec=0.027545452117919922;LogBytes=256;FailFast;EffSecLevel=none;ReqFormat=UNCOMPRESSED;ReqID=removed;GlobalID=removed;Server=ip:port
Now the error is a lot shorter, although still seems to be related to the same cause:
com.google.apps.framework.request.StatusException: generic::FAILED_PRECONDITION:
The spinner in the dashboard appears to spin forever, while the error appears underneath alerts after a few seconds. I have tried numerous project names and all fail with the same error.
Is there some type of quota I am missing that is preventing this? The quota menu item requires me to select a project, which I don't have any.
Clicking on the error brings me to a page with the following message:
You don't have permissions to perform the action on the selected resource.
Make sure that the Google Developers Console is on for the user that is trying to create the project.
Admin.google.com > Apps > Additional Google services > Google Developers Console and turn on for any org or user that needs it.
Looks like there's another possible cause, in addition to the one that #AndrewL provided in his solution.
Short answer:
I ran into the same error when I attempted to associate a new GCP project with our billing account via Terraform. Our billing account has a default limit of 5 projects (which we had already met), and this blocked the association of new accounts and generated the Error 400: Precondition check failed., failedPreconditionerror message. To fix, I had to remove/delete one of the already associated projects before I could add a new one.
Long answser:
Here is the error message I encountered in Terraform (sensitive data and IDs redacted):
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
~ module.<MY MODULE PATH>.project
billing_account: "" => "<MY BILLING ACCOUNT ID>"
Plan: 0 to add, 1 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
module.<MY MODULE PATH>.project: Modifying... (ID: <MY PROJECT ID>)
billing_account: "" => "<MY BILLING ACCOUNT ID>"
Error: Error applying plan:
1 error(s) occurred:
* module.<MY MODULE PATH>.project: 1 error(s) occurred:
* google_project.project: Error setting billing account "<MY BILLING ACCOUNT ID>" for project "projects/<MY PROJECT ID>": googleapi: Error 400: Precondition check failed., failedPrecondition
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
My billing account was at its maximum of 5 projects. As a test, I removed one of the projects and then ran Terraform again. It then successfully added the new project to the billing account. To double check, I attempted to add yet another new project to the billing account (to push the amount to 6) and then received the same error message again.
Straight up deleting one of the associated projects also works.
It stands to reason that requesting a limit increase for your billing account's associated projects will also fix this issue.
Another possible reason for this error can be accessing the .xlsx file. If you are accessing this file using Google spreadsheet then you need to save the .xlsx file in to save as google sheets by choosing the option available in the File menu at the top.
Thanks
Another possible reason for this is Organization policy, denying the particular API on ORG/Folder/project level.
For me the error was working because I was trying to read the file from a shared google folder. Check if the drive where the file lives is your drive and not a shared one.

Login failed for user 'sa' when the app is run from VS 2015

I have a console application which hosts two WebApi applications using OWIN Self Host approach. One of the apps uses EF6 with Code First. When I run the executable from the bin folder and make a request to the WebApi, everything works like it should - if the database is already created it just returns the results, otherwise it creates the db first. But if I start the console app from Visual Studio (with debugging), I receive the following error:
Additional information: Cannot open database "{db name}" requested by the login. The login failed.
Login failed for user 'sa'.
Anyone has any ideas why this happens?
EDIT: Problem is not related to the self hosted apps. I referenced the dbcontext directly in the console app and the same issue happens. I also tried Integrated Security and it still fails with "Login failed for user '{DOMAIN\USERNAME}'."
EDIT 2: I fixed my problem by doing deleting the .suo file. That helped me find these two questions mentioning the same solution:
Login failed for user "xxx" Failed to open the explicitly specified database solution
EF 4.1 code first causes weird (login) runtime errors
Can anyone say the reason why the .suo file causes this?

Resources