Recover Cloud functions default service account with the undelete POST call - google-app-engine

I have used Google Cloud Functions for quite a long time, with no real authentication problem for now.
Today I meet this error while deploying a new function
ERROR: (gcloud.functions.deploy) ResponseError: status=[400], code=[Bad Request], message=[Default service account 'PROJECT-ID#appspot.gserviceaccount.com' doesn't exist. Please recreate this account (for example by disabling and enabling the Cloud Functions API), or specify a different account.]
I tried several things :
disable/enable GCF API : no service account recovered
gcloud beta app repair reference here
No default service account recovered
the undelete API POST call
If I understand well the current GCP features, using the last option is my best solution, but somehow I keep getting a 400 error
I found my unique-id in my log activity at the creation of the default service account
I really can't see where is the problem in the undelete API call and would be really thankful if you could help with it

Thanks to #Maxim, I know now that my problem comes from the fact that the deleting of this service account happened more than 30 days ago. Which means that it has already been purged from the system and it's not recoverable anymore.
In case you meet this same kind of problem, please try out this link :
https://cloud.google.com/iam/docs/creating-managing-service-accounts#undeleting_a_service_account

I see three alternative ways in how to proceed here next:
Create a new project from scratch to work from.
File a support case via the support center.
Open a private issue by providing your project number in the following component.
I believe it's convenient in reaching out GCP Support for help at this stage, and recommend you to do so; seeing as you've attempted most if not all ways of Service Account recovery to no success.
On a last note, as for the latter option, the contents of the private issue will only be visible to you, and to the GCP Support staff (us). If you choose this option, please let me know when it's opened, and I'll start working on it as soon as possible.

Related

I have got "403 Forbidden" using custom search engine on payed account

I am trying to use google search engine via python script. It was working fine at the beginning but later I have got "HTTP Error 403: Forbidden". I thing it is due to 100 requests per day limitation. But I have payed account and billing support told me that everyting is ok. Is it possible somehow to solve this problesm?
Thanks, Ilia
There are lot of reasons for which API will throw Error 403. You can find them all here : GOOGLE DOC FOR 403 Forbidden
Your 403 error might indicate that the API key you are using may have lost it's permissions, or that the quota of your API requests may have been exceeded and the new quota (The one you have when you already have a billing account) might not have been updated.
I assume you are using this API; If not, don't worry, the following advice might also help you.
You first need to see if your API key is still working or you might want to generate new ones. You can do this here. Your code should make reference to the new API Key file.
If it is not the case then you should wait a little bit until your Billing account is updated and the quota gets readjusted. You can read a bit more about how to monitor the requests to your APIs here.
You can always find more help with your particular issue if you describe a little the symptoms and your attempts or hypothesis to solve it.
At last you may find more info on the community page of the API.

Codename One Preferences/Storage permissions

I have developed and published an app in Google Play Store, which only send simple String request to REST API and store the results in the Preferences. The same app is also submitted to Windows Store for publication, however it was rejected due to the following reason:
The app declares use of the sensitive capability [musicLibrary, picturesLibrary, videosLibrary] without appearing to access the declared capability. Please removed the sensitive capability declaration and re-submit the app.
Upon inspection to Google Play Store submission, I noticed the same permissions are requested:
This app has access to:Photos/Media/Filesread the contents of your USB storagemodify or delete the contents of your USB storageStorageread the contents of your USB storagemodify or delete the contents of your USB storageOtherreceive data from Internetview network connectionsfull network accessprevent device from sleeping
So my question is, do Preferences really need these permissions, or can I set some kind of build hints to remove these permission requests, especially for UWP build? I have also tried to set android.blockExternalStoragePermission build hint, but the permissions are still requested in Android build. I have yet to try iOS build since currently I don't have Apple Developer account.
Thank you very much in advance.
Edit #1 (23/10/2018):
Upon further inspection, I found that I have mistakenly uploaded the version that didn't declare android.blockExternalStoragePermission to Google Play Store, so all good on Android version.
Currently I'm not using any of cn1libs, and here's the list of all classes imported in my application:
java.util.HashMapjava.util.Mapjava.util.Randomcom.codename1.components.InfiniteProgresscom.codename1.components.ToastBarcom.codename1.components.ToastBar.Statuscom.codename1.io.CharArrayReadercom.codename1.io.JSONParsercom.codename1.io.Logcom.codename1.io.NetworkManagercom.codename1.io.Preferencescom.codename1.io.rest.Responsecom.codename1.io.rest.Restcom.codename1.l10n.L10NManagercom.codename1.ui.Buttoncom.codename1.ui.Componentcom.codename1.ui.Containercom.codename1.ui.Dialogcom.codename1.ui.FontImagecom.codename1.ui.Formcom.codename1.ui.Labelcom.codename1.ui.events.ActionEventcom.codename1.ui.events.ActionListenercom.codename1.ui.layouts.BorderLayoutcom.codename1.ui.layouts.FlowLayoutcom.codename1.ui.layouts.GridLayoutcom.codename1.ui.plaf.Bordercom.codename1.ui.plaf.Stylecom.codename1.ui.plaf.UIManagercom.codename1.ui.util.Resources
So my original question remain, how do I set the build hints to prevent the same external storage read/write permission in Windows and iOS?
See the section titled "Android Permissions" here, for a list of some API's that might trigger extra permissions. I suggest extracting the manifest from the XML and inspecting it. It should include two permissions based on your description you should have two permissions there:
android.permission.WRITE_EXTERNAL_STORAGE - which you should have been disabled when you applied android.blockExternalStoragePermission
android.permission.INTERNET - this one you actually need
I'm assuming you have a permission for media access and here it becomes a question of where it came from?
Did you use a cn1lib that might include a feature that triggers this?
Do you have a feature in the app that isn't active yet?
Once you have the specific name or results of this investigation comment here and I'll revise the answer with more details.

Bug: 500 Internal Server Error while calling Google Static Maps API

Good afternoon.
We've recently noticed a growing number a API call failure when trying to reach your Google Static Maps API.
Issues initially seemed intermittent, but seems to happen a lot more frequently, if not: all the time.
What steps will reproduce the problem? Please provide a link to a
demonstration page if at all possible, or attach code.
Totally works locally or in a web browser
Sends out a 500 Internal Server Error when on our staging/production systems
Could that be related to authentication? To my knowledge, API keys aren't really enforced locally, but definitely checked for when application runs on a live system.
Doesn't report as an error in our Google API Console. Just as a regular successful call.
Sample URL:
https://maps.googleapis.com/maps/api/staticmap?center=38.121504,-122.590525&scale=2&visual_refresh=true&size=280x188&key=OUR_BROWSER_API_KEY&markers=icon:http://stage.hometrendsreport.com/images/mini_orange.png|shadow:false|38.121504,-122.590525&markers=icon:http://stage.hometrendsreport.com/images/mini_blue.png|shadow:false|38.121073,-122.5932|38.123742,-122.591363|38.123981,-122.590448|38.124226,-122.589497|38.118754,-122.588585|38.119648,-122.587095|38.123877,-122.587494|38.118187,-122.592065|38.118038,-122.591357&markers=icon:http://stage.hometrendsreport.com/images/mini_gray.png|shadow:false|38.118442,-122.589865|38.118442,-122.589865|38.12166,-122.602269|38.116919,-122.571937
Here's our code snippet, using ruby/paperclip:
self.picture = URI.parse(google_map_url.to_s)
return self.save
Any idea why this is happening?
Any help gladly appreciated.
Best regards,
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
When I access the link I get an "invalid API key", so the API Key may be the problem. I believe there are also much lower quota for requests to the static map API, while testing you may have exceeded your quota.

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.

How can i get a connection ticket to quickbooks online for dev/testing a one off web app?

I'm trying to build a one off webapp that will communicate with our business QuickBooks Online account. Most of the research I've found says for development and testing, use the "desktop" way of connecting (to avoid cert headaches). So I've registered an app and got the id from here:
appreg.intuit.com/
The problem is, everywhere I've seen tell me then to go here to get a connection ticket
login.ptc.quickbooks.com/j/qbn/sdkapp/confirm?serviceid=2004&appid=YOUR-APPLICATION-ID-HERE
When I do that however, it redirects me to here
qbo.intuit.com/c1/v60.147/0/login?redirect=true
I mucked around with and finally find some way to access the "old" quick books stuff, when i went to setup a test company it sent me here
ptc.qbo.intuit.com/c1/v0/offline.shtml
which tells me
"The QBO PTC environment is no longer available, and was replaced by the new E2E environment. Please go to https://e2e.qbo.intuit.com/ going forward. We are very sorry for any inconvenience and confusion. If you have questions, please reach out to Eric Bullen"
How can I get a connection to a test account to do some development?
How can I get a connection to a test account to do some development?
Unless you're an Intuit employee, you can't get a test account.
With that said, you don't need to.
Just use your live QuickBooks Online account. You can sign up on their website to get a 30-day free trial if you need to.
When you register at https://appreg.intuit.com new link - http://developer.intuit.com/Application/Create/QBOE, make sure you register in DESKTOP mode, for the PRODUCTION environment.
Then use the production URL to get your connection ticket:
https://login.quickbooks.com/j/qbn/sdkapp/confirm?appid=YOUR-APPLICATION-ID-HERE&serviceid=2004&appdata=1
(substitute in your application ID that you get back from appreg)
More info and examples on our QuickBooks integration wiki.

Resources