[google-appengine] Re: Using pubsub to trigger subsequent cloud build with filtering

2022-06-03 Thread Tom Harris

To be 100% explicit, I am adding the following into the Filters section of 
my Cloud Build Trigger, within the "Filter Editor" tab, as the first tab 
doesn't let me select anything useful from the build pub/sub message. This 
is right from the documentation.

*filter: build.status == Build.Status.SUCCESS*

And when I try to save my trigger, I receive this error at the bottom of 
the page:

*Failed to update trigger: generic::invalid_argument: ERROR: :1:7: 
Syntax error: mismatched input ':' expecting  | filter: build.status 
== Build.Status.SUCCESS | ..^*

I also tried removing "*filter: *" as it seems redundant to have that, but 
that also fails with an error:

*Failed to update trigger: generic::invalid_argument: ERROR: :1:1: 
undeclared reference to 'build' (in container '') | build.status == 
Build.Status.SUCCESS | ^ ERROR: :1:17: undeclared reference to 
'Build' (in container '') | build.status == Build.Status.SUCCESS | 
^*

Nothing I have tried seems to be valid in this and the documentation link 
right there in the trigger editor UI is exactly the documentation giving 
the examples.
[image: cloud-build-trigger-filters-error.png]

I've been working at this for a few days, and I'm out of ideas for making 
this function as documented. Please, some assistance is needed.

Thanks.

On Thursday, June 2, 2022 at 5:52:19 PM UTC-7 Tom Harris wrote:

>
> I have one cloud build trigger in one of our projects that deploys an App 
> Engine. I have also created a pubsub topic named 'cloud-builds' in this 
> same project, and I see that build event messages are being sent to that 
> topic during and at the end of builds.
>
> I am attempting to use this topic in another project with a pubsub cloud 
> build trigger. This works, but has no filtering, and as described on this 
> page, its firing the build way too often:
>
>
> https://cloud.google.com/build/docs/automating-builds/create-pubsub-triggers#risks_associated_with_an_unfiltered_trigger
>
> Now, all I need to determine how to do is add the filtering so only 
> successful builds with the right trigger ID are used. The documentation (
> https://cloud.google.com/build/docs/automating-builds/create-pubsub-triggers#using_cel_to_filter_build_events)
>  
> says to add something like this to my cloud build trigger filter:
>
> filter: build.build_trigger_id == "redacted" && build.status == 
> Build.Status.SUCCESS
>
> However, I am never able to save my trigger, as whatever I type into the 
> filter fails syntax validation. All the examples given on that page fail. I 
> have not been able to find any examples on the net, either. I have tried 
> subsets of these, exactly as described in the documentation, and they all 
> fail with syntax errors.
>
> How is this supposed to be entered into the cloud build trigger filter? We 
> cannot have every one of the pubsub messages firing a build, as I saw at 
> least 15 messages delivered when there was no filter, triggering 15 builds 
> in quick succession, most of which failed due to app engine deployment 
> concurrency.
>
> Please, need some assistance. Also, better documentation around this area 
> would be good.
>
> Many thanks,
> Tom Harris
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/e4e20d14-8b5a-4922-93a7-06025f370e30n%40googlegroups.com.


[google-appengine] Re: The API call datastore_v3.Put() enable

2022-06-03 Thread Ankit Dwivedi
Thanks, Its working with your suggestion.

On Tuesday, 31 May 2022 at 01:07:06 UTC+5:30 NoCommandLine wrote:

> Correction -  '*gcloud beta app deploy*' 
>
> On Monday, May 30, 2022 at 12:33:27 PM UTC-7 NoCommandLine wrote:
>
>> Try deploying your app with *'gcloud app beta deploy' *instead of the 
>> normal 'gcloud app deploy'
>>
>> When 'Bundled API for Python 3' was first released, it was only available 
>> in beta and required you to use 'gcloud app beta' commands. If you didn't, 
>> you would get the error about enabling 'app_engine_apis' even when you had 
>> it enabled. 
>>
>> The github sample/documentation 
>>  still 
>> has that instruction but the main documentation 
>>  
>> no longer has it.
>>
>>
>>  * .* NoCommandLine *..*
>>  https://nocommandline.com
>> *A GUI for Google App Engine*
>>
>> On Monday, May 30, 2022 at 10:24:50 AM UTC-7 ankit...@gmail.com wrote:
>>
>>> Can anyone help us into this please.
>>>
>>> On Monday, 30 May 2022 at 16:34:51 UTC+5:30 Ankit Dwivedi wrote:
>>>
 Hi All,

 We are facing a issue when trying to use memcache in one of our 
 application and getting below error.

 Traceback (most recent call last): File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/flask/app.py", 
 line 2077, in wsgi_app response = self.full_dispatch_request() File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/flask/app.py", 
 line 1525, in full_dispatch_request rv = self.handle_user_exception(e) 
 File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/flask/app.py", 
 line 1523, in full_dispatch_request rv = self.dispatch_request() File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/flask/app.py", 
 line 1509, in dispatch_request return 
 self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) File 
 "/srv/main.py", line 32, in root store_visit(ip_addr, usr_agt) File 
 "/srv/main.py", line 16, in store_visit Visit(visitor='{}: 
 {}'.format(remote_addr, user_agent)).put() File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/model.py",
  
 line 3538, in _put return self._put_async(**ctx_options).get_result() File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/tasklets.py",
  
 line 397, in get_result self.check_success() File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/tasklets.py",
  
 line 394, in check_success six.reraise(self._exception.__class__, 
 self._exception, self._traceback) File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/six.py", line 
 719, in reraise raise value File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/tasklets.py",
  
 line 441, in _help_tasklet_along value = gen.throw(exc.__class__, exc, tb) 
 File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/context.py",
  
 line 850, in put key = yield self._put_batcher.add(entity, options) File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/tasklets.py",
  
 line 441, in _help_tasklet_along value = gen.throw(exc.__class__, exc, tb) 
 File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/context.py",
  
 line 382, in _put_tasklet keys = yield self._conn.async_put(options, 
 datastore_entities) File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/ext/ndb/tasklets.py",
  
 line 527, in _on_rpc_completion result = rpc.get_result() File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/api/apiproxy_stub_map.py",
  
 line 648, in get_result return self.__get_result_hook(self) File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/datastore/datastore_rpc.py",
  
 line 1875, in __put_hook self.check_rpc_success(rpc) File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/datastore/datastore_rpc.py",
  
 line 1365, in check_rpc_success rpc.check_success() File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/api/apiproxy_stub_map.py",
  
 line 614, in check_success self.__rpc.CheckSuccess() File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/api/apiproxy_rpc.py",
  
 line 149, in CheckSuccess raise self.exception File 
 "/layers/google.python.pip/pip/lib/python3.9/site-packages/google/appengine/runtime/default_api_stub.py",
  
 line 276, in _CaptureTrace f(**kwargs) File 
 "/layers/google.python.pip/pip/lib