Awesome. That's great to hear, Yannick.

On Friday, June 9, 2017 at 1:32:42 PM UTC-7, Yannick (Cloud Platform 
Support) wrote:
>
> Hello Jay-Nicolas, thank you very much for the detailed answer. I did 
> manage to replicate your issue when using the local dev server on a Windows 
> 10 VM. The code does otherwise work on App Engine and when ran directly 
> using a regular php installation.
>
> I did also have to deal with the "No CA Bundle" error and I agree that our 
> documentation isn't perfect but we are always striving to improve it.
>
> Since I've already reproduced the issue I've gone ahead and created an 
> issue for you on the Issue Tracker 
> <https://issuetracker.google.com/62490267>. It has been forwarded to the 
> product team and I future updates for this issue will be posted there.
>
> On Wednesday, June 7, 2017 at 3:20:12 PM UTC-4, Jay-Nicolas Hackleman 
> wrote:
>>
>> Hi Yannick,
>> I'm posting my resolution here for people with the same issue.
>> Basically what it comes down to is that this issue occurs on windows 
>> running dev_appserver and attempting to test your application locally. I 
>> would be curious to know if you could reproduce it knowing that, as it 
>> seems I'm not alone.
>>
>> I found someone reporting the issue to Guzzle here: 
>> https://github.com/guzzle/guzzle/issues/1640
>> and reported (in conjunction with another issue) to the google issue 
>> tracker here: https://issuetracker.google.com/issues/35900358
>>
>> The resolution was to modify Guzzle code (which I'm really not happy 
>> about having to do) to support googles implementation of php in the dev 
>> environment.
>>
>> I changed the file: 
>>
>> \vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php
>> line 370
>>
>>
>> At this statement:
>>
>> $conf[CURLOPT_FILE] = fopen('php://temp', 'w+');
>>
>> And added BELOW it:
>>
>> //JAY_NIC_CHANGE: GUZZLE_GOOGLE_WINDOWS_CURL_IMPLEMENTATION
>> if(isset($_SERVER['SERVER_SOFTWARE']) 
>> && 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Development/')) {
>> //echo "HEY HEREI AM";
>> $conf[CURLOPT_FILE] = fopen(getenv('temp').uniqid(), 'w+');
>> }
>>
>>
>>
>> Of course, modifying a dependency's code is a no-no... But I'm not really 
>> sure what else I'm supposed to do...
>>
>>
>> In addition to this issue, I first had to overcome the same set of errors 
>> that this guy encountered (linked previously): 
>> https://issuetracker.google.com/issues/35900358
>> It seems that the certificate error: 
>> "*No system CA bundle could be found in any of the the common system 
>> locations. PHP versions earlier than 5.6 are not properly configured to use 
>> the system's CA bundle by default. In order to verify peer certificates, 
>> you will need to supply the path on disk to a certificate bundle to the 
>> 'verify' request option*"
>> - was ALSO plaguing this implementation. Again, I'd love to know if you 
>> follow those steps on a windows machine and attempt to test in the dev 
>> environment: if you'd get the same results. I suspect so.
>>
>> On a personal note: this is not the first time, (and I suspect not the 
>> last time) that the tutorials I've followed in the app engine just haven't 
>> worked, or have otherwise been vague, or incomplete. Being that I have 
>> deliverables to work with: I need to get this project done. But once it's 
>> working, I'm going to be moving the project over to heroku - I've followed 
>> all their tutorials, and things just work, no problems.
>>
>>
>> I hope this helps other people
>>
>> On Monday, June 5, 2017 at 1:39:21 PM UTC-7, Yannick (Cloud Platform 
>> Support) wrote:
>>>
>>> Hello Jay-Nicolas. I have not been able to reproduce your issue when 
>>> testing this code sample, so there might be something wrong with your 
>>> environment. You can also go here 
>>> <https://cloud.google.com/appengine/docs/flexible/php/using-cloud-datastore>
>>>  
>>> to report an issue for this code sample. You could also try following the 
>>> instructions from this tutorial 
>>> <https://cloud.google.com/datastore/docs/datastore-api-tutorial>.
>>>
>>> On Sunday, June 4, 2017 at 4:59:43 PM UTC-4, Jay-Nicolas Hackleman wrote:
>>>>
>>>> Hi,
>>>>
>>>> I've followed this tutorial: 
>>>> https://cloud.google.com/datastore/docs/reference/libraries#client-libraries-usage-php
>>>>
>>>> I'm attempting to run the code in the local dev_appserver, but I get 
>>>> the following exception:
>>>>
>>>>
>>>> *Fatal error*: Uncaught exception 
>>>> 'Google\Cloud\Core\Exception\ServiceException' with message 
>>>> 'curl_setopt_array(): cannot represent a stream of type MEMORY as a STDIO 
>>>> FILE*' in 
>>>> K:\AppEngineProjects\IronOakAppspot\vendor\google\cloud-core\RequestWrapper.php:241
>>>>  
>>>> Stack trace: #0 
>>>> K:\AppEngineProjects\IronOakAppspot\vendor\google\cloud-core\RequestWrapper.php(150):
>>>>  
>>>> Google\Cloud\Core\RequestWrapper->convertToGoogleException(Object(Google\Cloud\Core\Exception\ServiceException))
>>>>  
>>>> #1 
>>>> K:\AppEngineProjects\IronOakAppspot\vendor\google\cloud-core\RestTrait.php(86):
>>>>  
>>>> Google\Cloud\Core\RequestWrapper->send(Object(GuzzleHttp\Psr7\Request), 
>>>> Array) #2 
>>>> K:\AppEngineProjects\IronOakAppspot\vendor\google\cloud-datastore\Connection\Rest.php(81):
>>>>  
>>>> Google\Cloud\Datastore\Connection\Rest->send('projects', 'commit', Array) 
>>>> #3 
>>>> K:\AppEngineProjects\IronOakAppspot\vendor\google\cloud-datastore\Operation.php(447):
>>>>  
>>>> Google\Cloud\Datastore\Connection\Rest->commit(Array) #4 
>>>> K:\AppEngineProjects\IronOakAppspot\vendor\google\cloud-datastore\DatastoreClient.php(
>>>>  
>>>> in 
>>>> *K:\AppEngineProjects\IronOakAppspot\vendor\google\cloud-core\RequestWrapper.php*
>>>>  on 
>>>> line *241*
>>>>
>>>> How do I fix this?
>>>> Thanks
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/5601ee9f-523b-4618-89c5-f5ed6aec41de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to