Pub Sub Topic not associated with Project error - google-cloud-pubsub

I'm trying to subscribe to push notifications from Google Classroom using this link and getting the following error. I have created the project, the topic and subscription under the same project and added the service account permissions as noted in the docs.
Right now I'm working on this in the API Explorer on this page.
I can verify that the topic lives under the developer console project.
Are there any other issues that would cause the topic to not be visible in this project?
{
"error": {
"code": 403,
"message": "#TopicNotOwnedByProject The specified Cloud Pub/Sub topic does not belong to your Developer Console project.",
"status": "PERMISSION_DENIED"
}
}

After a lot of frustration, I've realized that running the API Explorer will never result in a succesful API call because the API calls are not in my project scope but instead, whatever project the "API Explorer" runs in. This could be resolved if the API Explorer allowed you to select a project to run the sample requests in.
I went ahead and wrote out the code directly and it is working as expected.

Related

How to patch env_variable using REST API in App Engine Standard?

Lately I've been deploying apps on App Engine Standard and sometimes I accidentally deploy a version with a typo in my env_variables specified on app.yaml. Let's say that I don't want to deploy a new version because it takes time and this typo should be easily fixed with a "quick patch".
I followed the GAE Admin REST API doc and played around with the API Explorer. It turns out that the request body accepts envVariables so I was thinking that this API can solve my problem but for some reason it fails.
Error:
{
"error": {
"code": 400,
"message": "This operation is only supported on the following field(s): [automatic_scaling.cool_down_period_sec, automatic_scaling.cpu_utilization.target_utilization, automatic_scaling.max_idle_instances, automatic_scaling.max_total_instances, automatic_scaling.min_idle_instances, automatic_scaling.min_total_instances, automatic_scaling.standard_scheduler_settings.max_instances, automatic_scaling.standard_scheduler_settings.min_instances, automatic_scaling.standard_scheduler_settings.target_cpu_utilization, automatic_scaling.standard_scheduler_settings.target_throughput_utilization, instance_class, manual_scaling.instances, serving_status]",
"status": "INVALID_ARGUMENT"
}
}
Request Parameters:
appsId: PROJECT_ID
servicesId: SERVICE_NAME
versionsId: 2021xxxxx
updateMask: envVariables
Request Body:
{
"envVariables": {
"my_key":"my_value"
}
}
Overall question: Is it not possible to patch env_variables on App Engine Standard using REST API or I'm just missing something? Are there any alternatives to avoid redeployment?
Nope, there is no other alternative for this particular use case.
The reason you cannot modify the envVariables using GAE Rest API is that those variables are used when your app is being built in App Engine, so modifying them will imply re-build all the app which implies at the same time you need to redeploy the app.
You can modify the scaling settings since those not depend on the application or how it is built.
Now, that you're able to see envVariables as an option in the API explorer does not mean it is intended to be used with apps.services.versions.patch, in fact that option is shown as well with others just like a generic menu with all the possible options in the API but in the documentation you share it is not mentioned you can use it for the particular method you mention.

API key doesnt work, still get error code same as if no API key

Using SP Simple Maps module with Joomla 3.
Applied for API, got it, put it in place in module, no problem. But website still shows map as grayed out and error message same as before API:
This page didn't load Google Maps correctly. See the JavaScript console for technical details.
www.222project.com
This is the error I am getting in console in your contact page
Google Maps API error: ApiNotActivatedMapError https://developers.google.com/maps/documentation/javascript/error-messages#api-not-activated-map-error
You have to activate the API from console. Go to Dashboard and you can see the activate option.
There are some changes after June 22, 2016. there are some links that may help you
Google Maps API error: Google Maps API error: ApiNotActivatedMapError
https://superstorefinder.net/support/knowledgebase/google-maps-api-keys-usage-and-limits/
http://superstorefinder.net/support/knowledgebase/new-google-maps-after-22-june-2016-will-require-google-api-key/

SharePoint 2010 listdata.svc REST API throwing unexpected 500 Error

We wrote an application that consumes the SharePoint 2010 REST API. The application works fine in our Dev and Test environments. When we try our production site we get a 500 status code and the following is in the response body.
{
"error": {
"code": "",
"message": {
"lang": "en-US",
"value": "An error occurred while processing this request."
}
}
}
We have checked for code, and list definition mismatches against all environments. We have checked the SharePoint and Windows application logs. We are checking to see if maybe some bad data is causing the problem.
Really scratching our head over here on this one.
Any ideas would be much appreciated.
Background
SharePoint 2010 Server
Using SharePoint 2010 REST service listdata.svc
Using AngularJS $http service to call the REST API
Only one of 6 Lists return the 500 errors
Can reproduce error using Postman.
Update
We have confirmed that it is not a data issue.
I ran into a similar problem yesterday, I rolled back any changes I had been working on and it turned out to be related to my workflows. I backed up the workflows with this Export to Visio method Export to Visio and deleted all my workflows. And it the REST service started working again for this list, other lists were still working fine. One of my workflows had an impersonate step that I suspect has something to do with locking up the service.
I was about to backup/restore the list but got lucky with this fix.

Invalid and/or missing SSL certificate when using Google App Engine

UPDATE: Please, if anyone can help: Google is waiting for inputs and examples of this problem on their bug tracking tool. If you have reproducible steps for this issue, please share them on: https://code.google.com/p/googleappengine/issues/detail?id=10937
I'm trying to fetch data from the StackExchange API using a Google App Engine backend. As you may know, some of StackExchange's APIs are site-specific, requiring developers to run queries against every site the user is registered in.
So, here's my backend code for fetching timeline data from these sites. The feed_info_site variable holds the StackExchange site name (such as 'security', 'serverfault', etc.).
data = json.loads(urllib.urlopen("%sme/timeline?%s" %
(self.API_BASE_URL, urllib.urlencode({"pagesize": 100,
"fromdate": se_since_timestamp, "filter": "!9WWBR
(nmw", "site": feed_info_site, "access_token":
decrypt(self.API_ACCESS_TOKEN_SECRET, self.access_token), "key":
self.API_APP_KEY}))).read())
for item in data['items']:
... # code for parsing timeline items
When running this query on all sites except Stack Overflow, everything works OK. What's weird is, when the feed_info_site variable is set to 'stackoverflow', I get the following error from Google App Engine:
HTTPException: Invalid and/or missing SSL certificate for URL:
https://api.stackexchange.com/2.2/me/timeline?
filter=%219WWBR%28nmw&access_token=
<ACCESS_TOKEN_REMOVED>&fromdate=1&pagesize=100&key=
<API_KEY_REMOVED>&site=stackoverflow
Of course, if I run the same query in Safari, I get the JSON results I'm expecting from the API. So the problem really lies in Google's URLfetch service. I found several topics here on Stack Overflow related to similar HTTPS/SSL exceptions, but no accepted answer solved my problems. I tried removing cacerts.txt files. I also tried making the call with validate_certificate=False, with no success.
I think the problem is not strictly related to HTTPS/SSL. If so, how would you explain that changing a single API parameter would make the request to fail?
Wait for the next update to the app engine (scheduled one soon) then update.
Replace browserid.org/verify with another service (verifier.loogin.persona.org/verify is a good service hosted by Mozilla what could be used)
Make sure cacerts.txt doesnt exist (looks like you have sorted but just in-case :-) )
Attempt again
Good luck!
-Brendan
I was facing the same error, google has updated the app engine now, error resolved, please check the updated docs.

Unsure on how to solve a "termsOfServiceNotAccepted" Error

Background:
So I'm a novice to the whole app engine thing: I have made an app on google app engine that on the main page accepts user input and then sends the information to a handler that then uses the Big Query API to run a synchronous query with some tables I have uploaded to Big Query. The handler then sends back the results of the query as a json.
Problem:
In deployment it works mostly except sometimes a user can often run into this error while trying to make the synchronous query:
Error in runSyncQuery:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "termsOfServiceNotAccepted",
"message": "BigQuery Terms of Service have not been accepted"
}
],
"code": 403,
"message": "BigQuery Terms of Service have not been accepted"
}
}
After doing some searching I com across this:
https://groups.google.com/forum/#!msg/bigquery-announce/l0kwVNpQX5A/ct0MglMmYMwJ
If you make API calls that are authenticated as an end user, then API calls will soon return errors when the end user has not accepted the updated Terms of Service. Apps built against the BigQuery API should ideally look for those errors and direct the user to the Google APIs Console to accept the new terms.
Except I dont really understand how to do this.
Also all the potential user accounts that I have tested my app with have access to a specific project that has Big Query API enabled, and can use the API so why does this pop up?
Also there are times when a specific account does not run into this problem. For instance if I keep refreshing and retrying to use the app eventually it will not have this problem and work. But then the next time this error will resurface again.
I don't understand how a user can have accepted the terms of service at one point of time and then not another at some point in the future?
Yes, any end users who authorize access to the BigQuery API must accept the Terms of Service (ToS) provided by the Google Developers Console at https://developers.google.com/console
It is possible that Terms of Service can change, and that some of your project members have not yet accepted updated BigQuery ToS. If one of your users is receiving this message when authorizing access to the BigQuery API, you redirect them to the https://developers.google.com/console to accept the terms of service.
Re: "specific account does not run into this problem" - can you confirm this is happening consistently with a specific account on a specific project?

Resources