While trying to deploy the sample Google Actions Transactions API to Google Cloud Functions using firebase as per the instructions here, I encountered a problem where the firebase deploy --only functions just hanged doing nothing (did not print any error on firebase CLI). the firebase debug logs also did not give a clue of the issue.
Please help.
Thanks!
-Kunal
I found a workaroud for this problem as mentioned here. I am trying to deploy the Google Cloud Function using Firebase from behind a corporate proxy. It appears that Firebase does not read proxy settings from the environment variables. This is an open issue.
Workaround:
Go to (on Windows)
C:\Users\YOUR_USER_NAME\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\firebase\node_modules\faye-websocket\lib\faye\websocket\client.js
And update code to use your proxy server:port-
`var Client = function(_url, protocols, options) {
options = options || {};
options.proxy = {
origin: '**YOUR_PROXY_SERVER:PORT**',
headers: {'User-Agent': 'node'},
}`
This work around can be used in DEV mode until Firebase provides permanent fix.
Enjoy!
Related
I am trying to migrate my chrome extension from MV2 - MV3, The app makes several API calls. When I build and install the extension locally it works fine but when I test the published version of the app... It doesn't make any internet connection. The extension is built using reactJS + parcel v1
Has anyone also faced these issues before, I cannot tell what I am doing wrong?
Here's is my the log of the error I am getting
In the manifest.json I set the host_permission like so
}
...
"host_permissions": [
"https://api.openweathermap.org/data/2.5/onecall",
"https://disease.sh/v3/covid-19/countries/",
"https://type.fit/api/quotes",
"http://ip-api.com/json"
]
...
}
I have deployed few functions in twilio serverless.If I mistakenly delet that local file from where I deployed the function.Or if this function is deployed by someone else.As there is no way to change the functions from UI,we must have to do it from cli.
The way I found is fetching,updating,building,deploying function by providing its service ,enviornment ,function ,build,deploy sid each time by function api by curl/twilio cli.Its very tedious and error prone to provide all those sid mentioned above. there should be an easy way just like when I have all the file locally and with a one twilio cli command I can change and deploy.
Whats the easiest way to download the file from serverless to local environment to change and re-deploy it again from cli just like I did first time( just run twilio serveless:deploy )?
You can modify Twilio Functions (via the GUI) created with the serverless cli by sending the following request.
Read only services and editing in the new Functions UI
Example:
client.serverless.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update({uiEditable: true})
.then(service => console.log(service.friendlyName));
You can also use tooling for the severless API to make working with it incredibly easy, reference:
Deploy Twilio Functions with the Serverless extension for VSCode
I'm logging in with clasp login --creds <file> which produces a local .clasprc.json file.
It says that I am logged in, but when I run another command I get:
Could not read API credentials. Are you logged in globally?
Any thoughts on why its not looking at my local clasprc file first?
Currently using version clasp v. 2.2.0
I ran into the same problem on Windows 10 and found that you need to login both globally and locally to use clasp run. There should be a .clasprc.json file in both your project folder and user folder.
I think I have finally found the solution for the same problem
Follow along with the comments from this github issue
Add the "oauthScopes" field to your local code and push it to your app
If you can't push, then copy-paste it to manifest file in the browser
Then you have to publish the app, and there were few things I've done, not sure which one helped. In the app in browser:
add the app version in File->Manage Versions
Publish -> Deploy as API executable
try to login with clasp and creds.json file
try to run something clasp run testRun
it may show the error that you're missing some oauth permissions, but it will list which ones, and you can add them
In my case, one weird thing that also helped was to enable some Google API
so in the app in browser: Resources -> Advanced Google Services -> enable some API
then try to do clasp run
if it works, you can disable the API that you have enabled previously.
Hope that helps
it's possible to setup a Open URL for MIME type support at (console.developer.google.com). That's create and works fine for my application. But only for the product instance at Google Cloud. In detail:
I've released my application in version 1. It's AppEngine base and it supports a Open URL myapp.appspot.com/oauth2callback. So after the release I will going on with feature development for version 2. I use the local AppEngine dev setup. So I take my second client ID and change the Open URL to my local workstation mydev.workstation.com:8080/oauth2callback. That works fine, but it breaks my product instance. Is there any workaround to use Open URL for the production instance and a second Open URL for my dev instance? In my opinion the Drive SDK settings should be:
enable Authentication Production:
Client ID: xxx
Additional Scopes:
Install URL:
Open URL: https://myapp.appspot.com/oauth2callback
enable Authentication Development:
Client ID: xxx
Additional Scopes:
Install URL:
Open URL: http://devworkstation.com:8080/oauth2callback
Jens
Create separate projects in the console for prod/qa/dev
The answer from #SteveBazyl is the preferred one for all the reasons stated. A kludgy alternative would be to have the servlet that is bound to the Open URL detect when it is dealing with a test scenario and do a 301 redirect to your dev server.
Also, the API URL is pretty consistent, so once you've sniffed it once, it's not to difficult to path the host and use it in a curl script or browser bookmark for local testing.
As an aside "oauth2callback" is a slightly odd name for your Drive Open URL. It's not wrong, but "driveopen" would show the separate concerns.
I'm using the Google Drive SDK and I made a simple app with a sharing feature. Unfortunately, when a document is shared with a user who doesn't have my app installed, they are prompted with the following message:
You do not have StoryPad installed
This item was created with StoryPad, a Google Drive app you have not installed.
However they don't see a link or an option to install this app. Is there a way to configure it so that they are prompted to install on this screen? I don't want users to have to hunt around looking for a way to install this app because they will leave.
Here is a screenshot of how it looks:
Looking at the Google Drive SDK documentation, in the error handling section, it seems if you trap the error:
`403: The authenticated user has not installed the app with client id {clientId}
The user has not installed the requesting app, or has uninstalled it.`
The documented suggested action is to:
Direct the user to the Chrome Web Store to install the app.
You don't list which language you're working with, so an example (other languages are listed on the above referenced page as well) in JavaScript could be:
request.execute(function(resp) {
if (!resp.error) {
//Excellent, everything is working correctly! Proceed to show your file.
} else {
console.log('Error code: ' + resp.error.code);
if (resp.error.reason == "appNotInstalled") {
//Here is where you implement the action to inform the user where to download your app.
alert("You need to install StoryBoard to view this file! Please proceed here: http://<link to your app>");
}
// More error information can be retrieved with resp.error.errors.
}
});