-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-1511776: PDO_Snowflake through proxy returns Failure when receiving data from the peer? #389
Comments
hi - driver's behaviour is different from when you do a manual unfortunately the error you sent, is only the part of the actual error. it is not included what was the failure when receiving data from the peer. can you please try configuring the PHP driver's connection as per https://github.com/snowflakedb/pdo_snowflake?tab=readme-ov-file#proxy if you need to send it through the proxy ? make sure please the proxy doesn't inject its own custom CA because then the validation will fail (if it must modify the chain, please add the proxy's own intermediary CA to if it still doesn't work, please enable debug logging with adding
to the driver config, reproduce the issue then post the logs here. Please make sure to sanitize them before posting though; account name , any other sensitive information. Alternatively if you're reluctant posting that info here, you can work with a support engineer 1:1 when creating a Support Case with Snowflake. |
Thank you for the response. This is what I am using in PHP (using individual proxy settings) This is what I have in the .ini file This is what openssl returns, I don't think the proxy is injecting it's own certificate(?). New log output : |
thanks for doing the test ! assuming there's no typo as result of sanitization process, this
looks incorrect. if you're connecting from the privatelink, please specify account as of course alternatively you can use the regionless notation for both privatelink ( Speaking about which; does the same setup with the same proxy; work using the public link and only fails for the privatelink one ? for the
for the private link, but please use the appropriate server name for public/private link you wish to test. Then do the same without the |
Let me know if I missed something from your post. I added the privatelink to the account and now I get an SSL error, I think privatelink was there before, but i've tried so many different variations I probably left it out accidentily. Region is not specified anywhere else but the account. No Proxy : Proxy :
I am able to connect and run queries through SnowSQL with the following, so I know the proxy is working. |
i started having doubts so to double-check our PHP driver still works with proxy in v3.0.0, i did the following:
$ cat snowflake.php
<?php
$account = "myaccount.eu-central-1.privatelink";
$user = "username";
$password = "password";
$dbh = new PDO("snowflake:account=$account;proxy=10.20.0.37:8080", $user, $password);
$dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
echo "Connected\n";
$sth = $dbh->query("select current_version()");
while ($row=$sth->fetch(PDO::FETCH_NUM)) {
echo "RESULT: " . $row[0] . "\n";
}
$dbh = null;
echo "OK\n";
?> Without any other configuration, simply run the script which as expected, resulted in an error
because the
which confirmed the PHP driver does work with the correct configuration even with proxy, over the private link.
in the logs you sent, confirms that the PHP driver encounters a certificate which it does not trust (= is not included in the You could:
so i navigated to the very end of the driver's
and added my own so it looked like this after the modification:
make sure header (BEGIN CERTIFICATE) and footer (END CERTIFICATE) is also included, unmodified, not just the cert.
All in all; the driver looks to be working as it should. |
there seems to be no response on this for a while now, so marking it as closed. of course if further help is needed or if you think you found a bug, please comment and can reopen and look further |
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
What version of PDO/PHP driver are you using? Snowflake PHP PDO Driver: 8.2.17-3.0.0
What operating system and processor architecture are you using? Debian GNU/Linux 11 (bullseye)
What version of C/C++ compiler are you using?
gcc 4:10.2.1-1
cmake 3.18.4
What did you do?
Tried rebuilding PDO_Snowflake
Changed Proxy settings
Tried from PHP as well as shell using Curl
What did you expect to see?
Results from my query.
Getting no results, PDO_Snowflake gives me the error below.
Can you set logging to DEBUG and collect the logs?
See snowflake_20240628162939.txt attachment.
snowflake_20240628162939.txt
What is your Snowflake account identifier, if any? (Optional)
I apologize if this is the wrong place to post this, if there is a better forum please let me know.
We are running a PHP server on an Azure App Service.
The account we are connecting to is https://*************.east-us-2.privatelink.snowflakecomputing.com
When trying to execute a query through PHP it's returning "Fatal error: Uncaught PDOException: SQLSTATE[08001] [240012] curl_easy_perform() failed: Failure when receiving data from the peer"
When I use Curl to send the http request to the server it returns a 302 redirect error. I solved this by adding CURLOPT_FOLLOWLOCATION to my code and it now returns the console page.
Does PDO_Snowflake follow redirects when going through a proxy server?
Is there a parameter I need to add to my code?
I was able to setup a private endpoint in azure and execute a query without the proxy, but only to test to make sure the driver works, Corporate policy wouldn't let me keep that setup.
Any help getting this working would be greatly appreciated.
TIA
The text was updated successfully, but these errors were encountered: