First time here? Check out the FAQ!
0

Connection issue

Hello,

I keep having a connection issue trying to connect throught PHRets

[2020-10-09 16:42:55] PHRETS.DEBUG: Loading Monolog\Logger logger [] []
[2020-10-09 16:42:55] PHRETS.DEBUG: Sending HTTP Request for http://maxebrdi-rets.paragonrels.com/rets/fnisrets.aspx/MAXEBRDI/login?rets-version=rets/1.7.2 (Login) {"auth":["**USER**","**PASS**","basic"],"headers":{"User-Agent":"PHRETS/2.6.1","RETS-Version":"RETS/1.7.2","Accept-Encoding":"gzip","Accept":"*/*"},"curl":{"10031":"/tmp/phretsRRoUkF"}} []
[2020-10-09 16:42:55] PHRETS.DEBUG: ClientException: 401: Client error: `GET http://maxebrdi-rets.paragonrels.com/rets/fnisrets.aspx/MAXEBRDI/login?rets-version=rets/1.7.2` resulted in a `401 Unauthorized` response [] []
http/promises/src/Promise.php(203): GuzzleHttp\\Middleware::GuzzleHttp\\{closure}(Object(GuzzleHttp\\Psr7\\Response))\n#2 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\\Promise\\Promise::callHandler(1, Object(GuzzleHttp\\Psr7\\Response), Array)\n#3 /var/app/current/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\\Promise\\Promise::GuzzleHttp\\Promise\\{closure}()\n#4 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\\Promise\\TaskQueue->run(true)\n#5  in /var/app/current/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113

When I try to connect using Retsmd.com I don't seem to have any issues so I know the username and password are correct.

What am I doing wrong? We have a dozen other Rets connections running using the same code base without any issues.

Thanks Eric

eculus's avatar
eculus
asked 2020-10-12 14:14:51 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Requires Digest for HTTP and BASIC for HTTPS.

bwolven's avatar bwolven (2020-10-12 14:18:18 -0500) edit

You can try connecting in a browser with the Login url and see if it works there..
Otherwise i would need your account name to check.

bwolven's avatar bwolven (2020-10-12 16:53:35 -0500) edit

Were you able to connect?

bwolven's avatar bwolven (2020-10-13 11:15:30 -0500) edit

the username and password work when I try to connect through Retsmd.com, so I know it is not an issue with the credentials

eculus's avatar eculus (2020-10-13 14:21:09 -0500) edit
add a comment see more comments

1 Answer

0

I was thinking of the same thing

$config->setLoginUrl('http://maxebrdi-rets.paragonrels.com/rets/fnisrets.aspx/MAXEBRDI/login?rets-version=rets/1.7.2')
       ->setUsername('username')
       ->setPassword('password')
       ->setUserAgent('PHRETS/2.6.1')
      ->setRetsVersion('1.7.2')
      ->setHttpAuthenticationMethod('digest');

but still the same error

[Mon Oct 12 20:46:09.854995 2020] [php7:error] [pid 7028] [client 172.31.87.237:24426] PHP Fatal error:  Uncaught GuzzleHttp\\Exception\\ClientException: Client error: `GET http://maxebrdi-rets.paragonrels.com/rets/fnisrets.aspx/MAXEBRDI/login?rets-version=rets/1.7.2` resulted in a `401 Unauthorized` response in /var/app/current/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113\nStack trace:\n#0 /var/app/current/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\\Exception\\RequestException::create(Object(GuzzleHttp\\Psr7\\Request), Object(GuzzleHttp\\Psr7\\Response))\n#1 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\\Middleware::GuzzleHttp\\{closure}(Object(GuzzleHttp\\Psr7\\Response))\n#2 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\\Promise\\Promise::callHandler(1, Object(GuzzleHttp\\Psr7\\Response), Array)\n#3 /var/app/current/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\\Promise\\Promise::GuzzleHttp\\Promise\\{closure}()\n#4 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\\Promise\\TaskQueue->run(true)\n#5  in /var/app/current/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113

This one puzzles me :)

eculus's avatar
eculus
answered 2020-10-12 15:51:32 -0500
edit flag offensive 0 remove flag delete link

Comments

I can't really help without an account name so I can check in the logs. NO PASSWORDS.

bwolven's avatar bwolven (2020-10-13 14:38:49 -0500) edit

the username is 206539671

eculus's avatar eculus (2020-10-13 14:44:37 -0500) edit

In the logs, on 10/6, I see your "RETSMD/1.0" requests.
On 10/9, I see what appears to be a single browser login "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36."
But no other from your account other than those.
I used PHRETS and was able to login HTTP with your credentials. I copied the code you used below
And I see those requests in the logs. But nothing from your attempts.
Please verify auto-correct didn't change your user name or password when you entered them in PHRETS.

bwolven's avatar bwolven (2020-10-13 15:16:07 -0500) edit

ok, found the issue. it was a typo as you mentioned, a sneaky one, but I managed to log in.

eculus's avatar eculus (2020-10-13 16:44:47 -0500) edit

I see your entries in the logs now.
Glad it is fixed.

bwolven's avatar bwolven (2020-10-13 16:47:50 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer