Jump to content

Welcome! You're currently a Guest.

If you'd like to join in the Discussion, or access additional features in our forums, please sign in with your Evernote Account here. Have an Evernote Account but forgot your password? Reset it! Don't have an account yet? Create One! You'll need to set your Display Name before your first post.

Photo

Connection error

connecting

  • Please log in to reply
10 replies to this topic

#1 vampie

vampie

  • Pip
  • Title: Member
  • Group: Members
  • 7 posts

Posted 25 March 2012 - 07:54 PM

Hi all,

I'm trying the PHP single authentication example, and I'm getting the following error:

Fatal error: Uncaught exception 'TTransportException' with message 'THttpClient: Could not connect to sandbox.evernote.com:443/edam/user' in /opt/www/path/web/site/transport/THttpClient.php:196 Stack trace: #0 /opt/www/path/web/site/packages/UserStore/UserStore.php(55): THttpClient->flush() #1 /opt/www/path/web/site/packages/UserStore/UserStore.php(35): UserStoreClient->send_checkVersion('PHP EDAMTest', 1, 21) #2 /opt/www/path/web/site/index.php(62): UserStoreClient->checkVersion('PHP EDAMTest', 1, 21) #3 {main} thrown in /opt/www/path/web/site/transport/THttpClient.php on line 196


I've doublechecked the credentials and they seem correct.

I have no clue what could be the reason.

Perhaps because I'm running the script from the browser and not from the console?

Any idea's are welcome.

Thank you.


/edit:
running it from the console works.
How can I make it run from the browser?

Thanks.

Edited by vampie, 25 March 2012 - 08:00 PM.


#2 SethH

SethH

  • Title: Evernote Employee
  • Group: Evernote Employee
  • 684 posts

Posted 25 March 2012 - 08:32 PM

That's a networking error (Thrift's TTransportException thrown by the HTTP client), so you're having a problem connecting to our sandbox server. Since it works when you run the script from the command line, I'm assuming that there's some difference in the PHP environment when you run in the browser (presumably via Apache). The most common problem is the SSL configuration of your server - our script is making an outbound HTTPS request, and it may be the case that your SSL client environment isn't trusting our server certificate.

#3 vampie

vampie

  • Pip
  • Title: Member
  • Group: Members
  • 7 posts

Posted 26 March 2012 - 06:36 AM

Thank you for the answer.

So I'm gonne have to check with my host then?

and it may be the case that your SSL client environment isn't trusting our server certificate.

What do you mean with SSL environment?
Is that my browser or is that the apache server?

thank you

#4 SethH

SethH

  • Title: Evernote Employee
  • Group: Evernote Employee
  • 684 posts

Posted 26 March 2012 - 05:08 PM

Apache server - the PHP code that's running on your server is making an outbound HTTP request to our servers. You can test whether this is the problem by temporarily changing the UserStore URL from https://sandbox.evernote.com/... to http://sandbox.evernote.com/...

#5 vampie

vampie

  • Pip
  • Title: Member
  • Group: Members
  • 7 posts

Posted 27 March 2012 - 10:23 AM

Bummer.

I've changes this:
$evernoteHost = "sandbox.evernote.com";
$evernotePort = "443";
$evernoteScheme = "https";
to that:
$evernoteHost = "sandbox.evernote.com";
$evernotePort = "80";
$evernoteScheme = "http";
And I get the same error:

THttpClient: Could not connect to sandbox.evernote.com/edam/user


:( :( :( :(

#6 SethH

SethH

  • Title: Evernote Employee
  • Group: Evernote Employee
  • 684 posts

Posted 27 March 2012 - 11:20 PM

Ok, so it's not an SSL problem. Can you make an outbound connection to sandbox at all from that host? E.g., curl from the command line?

#7 vampie

vampie

  • Pip
  • Title: Member
  • Group: Members
  • 7 posts

Posted 28 March 2012 - 11:09 AM

Hi,

a curl works perfectly even from the site:

I've created a test.php and this shows the index page.
<?php
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "https://sandbox.evernote.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
// grab URL and pass it to the browser
curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
?>


#8 vampie

vampie

  • Pip
  • Title: Member
  • Group: Members
  • 7 posts

Posted 30 March 2012 - 01:46 PM

I solved the problem:

the setting "allow_url_fopen" was not enabled.
I enabled this for my subdomain and it worked immediately :-)

#9 Kaustubh

Kaustubh

  • Pip
  • Title: Member
  • Group: Members
  • 3 posts

Posted 11 July 2012 - 04:09 PM

vampie i am facing the same error but my allow_url_fopen is set to on
please can u help me

#10 robertphyatt

robertphyatt

  • Pip
  • Title: Member
  • Group: Members
  • 2 posts

Posted 12 December 2012 - 08:11 AM

Vampie--

Thanks for posting this. It fixed my problem.

#11 mellow-yellow

mellow-yellow

  • Pip
  • Title: Member
  • Group: Members
  • 15 posts

Posted 22 February 2013 - 05:10 PM

Don't ignore transient network issues on the server too! My server's internet provider had trouble today, thus causing this issue.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Clip to Evernote