Have anyone encountered this Error message, when trying to connect to ArangoDB from a React application [See first attached photo]? It seemed like, it could be an issue related to authentication... but I've tried using "_system" and my own databases, with booth "root" as username and with "root" as password as well as setting the password to "null". I've tried to create new users and tried to connect to the database... Nothing works... (what am I doing wrong? - I've gone through the documentation a billion times at this point). I will attach a photo of my code as well.
Image of error,
Image of my code
Here is a link to the list of error codes. Unfortunately, "error 0" is extremely unhelpful. However, I see two potential issues.
First is with your use of HTTPS - normally, you use would use HTTP to connect to port 8529. One caveat would be TLS (like --server.endpoint "http+tcp://127.0.0.1:8529" with arangosh), but that's not the same as HTTPS.
Second, your AQL query seems to be attempting to return an entire collection, which is not how AQL works. Try returning a static like RETURN 'yes' or use the format:
FOR doc IN collection
RETURN doc
Related
I'm experimenting with Iroha and Iroha-helpers (a js library to communicate with the network). I'm having issues to process a "TransferAssets" transaction, it gives me a 'STATEFUL_VALIDATION_FAILED' error message, but nothing else about why it's failing.
This happens when I tried to make an asset transfer between 'userA#test' and 'userB#test' . I do not get the same issues IF I perform this transaction with the sender being 'admin#test'. All accounts have a balance of the asset that I'm trying to transfer, and they all have the same role 'user' which has the 'can_transfer' 'can_receive' roles.
This issue only happens when 'admin#test' is not the sender. otherwise it works just fine. Does anyone have an idea on how can I solve this error ?
I figured the solution and it was a silly mistake I was making.
My understanding of 'CreatorAccountId' was that you always pass the accountId of the domain creator, in my case it was 'admin#test'. However is supposed to be the creator of the transaction. So to solve my issue I just need to pass the accountId of the person/account that was making the transaction, in my case I just needed to pass usera#test as creatorAccountId as well as the the private key of usera#test for signing.
To start, let me mention this is an in-browser project, so i can only use
<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js/dist/web3.min.js"></script>
So a few months back I made a dapp, which worked fine even tho I never set a provider, so I guessed it used the ones given by MetaMask.
However, i am using the guide here the only issue is the following code,
var account_global, connected = false;
async function connect() {
if (!connected) {
var wei;
const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' }); // Waits for connection to MetaMask.
account_global = accounts[0];
web3.eth.defaultAccount = account_global;
console.log(account_global.toString() + " connected!");
connected = true;
console.log(account_global);
}
}
connect();
This code used to output the address of the metamask user after they approved metamask on my dapp, however I am receiving the error
Uncaught (in promise) TypeError: Cannot read property 'request' of undefined
The error just says that, my actual goal if i have to add providers and all is to use the ones from metamask, and allow connecting to metamask, the rest of the functions such as transfer or others i know how to handle them, it just seems that my issues come when i try loading the page.
I dont have an ether node to use, not planning on using nodejs either, only a single html file displaying the Metamask address, hence using the in-browser web3js.
I hope its just me not realizing something simple, because I cant seem to find the reason I cannot use web3js right now.
The actual problem is, that you need to run your script on some server. For testing purposes you can use localhost.
Please, refer to this link on how to start local server. And just open your file via localhost:XXXX where XXXX - are the port number.
Solved the mystery, seems to be just like the error code showed
Uncaught (in promise) TypeError: Cannot read property 'request' of undefined
genuinely meant that window.ethereum was undefined, so for no exact reason MetaMask would not inject ethereum, noticed that after reading Metamask and Web3js documentation, that my issue had nothing to do with their code, in fact i am gonna end up using the code shown on this answer.
https://ethereum.stackexchange.com/a/78987
The issues seeems that no matter the browser Metamask would not inject, so i tested it on multiple websites that usually require Metamask to connect and other normal sites just as google.com, to my surprise every site would have Metamask injecting ethereum apart from my own test site, so it meant that my site was cursed or something, or just the fact that Metamask does not inject on unhosted websites (just had the files on my destop to test), instead on an actual host it did inject and my tests were working on those sites.
Conclusion
Metamask requires a normal host to inject, it wont inject on a random file opened on your own workstation.
I had the exact same issue and it turned out my HTML was a bit dodgy (had an extra tag before the <html> tag) and that was preventing MetaMask from injecting web3.
I need to connect to:
https://www.webselfstorage.com/webservices/externaldataaccessservice.asmx?WSDL
through Apigee to create a REST to SOAP to REST proxy.
I keep getting a box that pops up when I "fetch" the WSDL that reads "Server Error. Internal Error".
What Am I doing wrong here? The webservices documentation came with a username and password but there isn't a place to enter these on apigee so I have to wonder if that might be the issue.
Disclosure: I work at Apigee.
The internal error message is a problem in how we are displaying an error message when we run into a problem reading the WSDL and should be fixed in the future.
The reason it's having a problem reading your WSDL is because of this line, which exists several times in the WSDL:
<s:element ref="s:schema" />
I'm no XML expert, so what does that mean? There is a schema that contains an element that is in turn also schema? My head hurts. :)
Do you have any control over the WSDL, or is that a 3rd party WSDL that you can't modify?
I saved a copy of the file and made the following changes to get it to work. I added a line after the schema definition:
<s:schema elementFormDefault="qualified" targetNamespace="http://www.webselfstorage.com/WebServices/ExternalDataServices">
<s:element name="schema" type="s:schema"/>
Then changed the s:schema refs to:
<s:element ref="tns:schema" />
And the fetch worked...
I'll try to follow up with more details, but just wanted to give you an update of what I've found so far.
I'm trying to use chrome.identity.getAuthToken to get a token, but every time I try this error shows up:
OAuth2 request failed: Service responded with error: 'bad client id: {0}'
I have no idea why this is happening. The client ID I put in manifest.json is exactly the same as the one on the Google Developers Console, and the correct scopes is also included:
oauth2: {
"client_id": "NUMBERS-NUMBERS&LETTERS.apps.googleusercontent.com",
"scopes": ["https://www.googleapis.com/auth/SOME_SERVICE"]
}
The extension is up on the webstore, and I don't see why it is still giving the bad client ID error.
What is possibly causing this error? What am I missing here?
Just as a note for myself and for someone run into.
I have encounter this problems with chrome app , the answers is not my problem ,and finally I found the solution for my problem but produce the same error as the question.
As https://developer.chrome.com/apps/app_identity#client_id say is much special for chrome apps, you have to create a separate client id for your chrome app.
Go to the "API Access" navigation menu item and click on the Create an OAuth 2.0 client ID... blue button.
Enter the requested branding information, select the Installed application type.
you must to choose Installed application an set you Application ID.
what's your Application ID ?
chrome-extension://your application id
chrome-extension://gfmehiepojbflifceoplblionpfclfhf/
I overcomed this problem by setting up the email address and product name in "Consent screen" in the Google Developer Console.
Please refer to https://developers.google.com/console/help/new/#userconsent for detail.
I had a similar problem. Everything seemed to work fine on my own laptop, but when i ran it on another device i got that "bad client id" error.
My problem was that the client-id changed from one device to another, as i did not yet upload my extension to the chrome store.
To overcome that problem, i followed the instructions of How to change chrome packaged app id Or Why do we need key field in the manifest.json?.
You need to create a key to keep the client-id persistent through all devices.
Hope that helps finding the right answer for people with the same issue quicker.
I wrote an Android app that should 'connect' to a (private) forum using HTTP GET (and sometimes POST) requests. The basic idea is as such:
Login page where users submit their credentials. Login is performed by doing a HTTP POST (tried GET too, same result) to the Login page of the forum, with their username and password as the parameters. The request should return some cookies that I store in a BasicCookieStore.
Every page of the forum they want to visit is retrieved using HTTP GET. I parse the HTML source that I obtain and show them only the relevant info. In order to authenticate the users, the same BasicCookieStore that I used for login (step 1) is set as the cookiestore for the HttpClient.
This method has been working all the time during my testing, and has worked for my beta testers too. Now that I released the app, it became apparent that many users were having issues, especially on mobile connections (Wifi seems to be no problem).
By logging the HTML source that was returned in all the HTTP GET requests, I have a strong suspicion that the actual login works fine, but somehow the cookies don't get returned or stored or something in that direction. The problem is that the HTML source of the first page they will receive should be the list of forums. In the case of users with problems however, they get served a page that basically reads "You must enable Javascript to view this page".
The strange thing is, I don't receive that page when testing, nor do many of my users. Even worse: some users are now reporting it worked fine for them for days or weeks, and has now stopped working. Others have the exact opposite: not working for days, suddenly working now. One user has reported he was in Greece for 2 weeks, where it worked flawlessly, then he got back to Germany, and it stopped working again.
There seems to be a random component at play here.
I have tried various things, mostly with the way I do the HTTP GET requests. I started out using the normal DefaultHttpClient, with various settings, such as this:
HttpClient httpClient = new DefaultHttpClient();
// Define parameters
HttpParams httpParams = httpClient.getParams();
HttpConnectionParams.setConnectionTimeout(httpParams, TIMEOUT);
HttpConnectionParams.setSoTimeout(httpParams, TIMEOUT);
HttpProtocolParams.setVersion(httpParams, HttpVersion.HTTP_1_1);
// Set cookiestore (getCookieStore returns the same cookiestore)
HttpContext localContext = new BasicHttpContext();
localContext.setAttribute(ClientContext.COOKIE_STORE, getCookieStore());
HttpGet http = new HttpGet(url);
http.addHeader("Accept", ACCEPT_STRING);
http.addHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
// Execute
HttpResponse response = httpClient.execute(http, localContext);
//... Process result (omitted)
Now I have switched to using AndroidHttpClient instead, with the rest of the code basically unchanged, and seem to get the same result.
I have also tried using the AsyncHttpClient library, which works quite differently, but once again the same result. I tried using its PersistentCookieStore as well, and you guessed it - same result.
I am clueless at this point. Am I looking in the wrong direction? The fact that a website would respond with "you need to enable Javascript" for some users but not for all seems to indicate an issue with cookies. I don't know how a website determines if javascript is enabled, but surely with a HTTP GET request there is no javascript at play. So why do I (and many other users) get to the page without any problems, while others get the 'no javascript' message? The only reason I can think of is cookies, but I have no clue what the problem exactly is.
Any help would be much appreciated!
I doubt the problem is cookies. More likely is a network configuration problem.
For example, your user might have connected to a wifi hotspot with a captive portal page (which uses javascript to make you sign in before you can use the hotspot). In this case they should first open the browser, try to browse to (e.g.) http://google.com, get redirected, sign in, and then launch your app.
Or, your user might be connecting through a proxy. Many mobile carriers around the world will proxy their users' HTTP connections, sometimes doing horrible things to the content. Switching to HTTPS might help with that.