Vr33ni
Vr33ni

Reputation: 101

Cron jobs with firebase - Google Cloud IO error

I just recently set up Firebase functions. After making a simple helloWorld function work, I wanted to set up a cron job following this Google blog tutorial. I always get an error at this step:

gcloud app deploy app.yaml \ cron.yaml

I get following error message:

C:\Users\vreee\Firebase\functions-cron\appengine>gcloud app deploy app.yaml \ 
cron.yaml
WARNING: Automatic app detection is deprecated and will soon be removed. As 
an alternative, create an app.yaml file yourself using the directions at 
https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml (App Engine Flexible Environment) or 
https://cloud.google.com/appengine/docs/standard/python/config/appref (App 
Engine Standard Environment) under the tab for your language.
Deployment to Google App Engine requires an app.yaml file. This
command will run `gcloud beta app gen-config` to generate an app.yaml
file for you in the current directory (if the current directory does
not contain an App Engine service, please answer "no").

Do you want to continue (Y/n)?  y

This looks like a Python app.  If so, please enter the command to run
the app in production (enter nothing if it's not a python app): :
Writing [app.yaml] to [C:\].
ERROR: gcloud crashed (IOError): [Errno 13] Permission denied: 
u'C:\\app.yaml'

If you would like to report this issue, please run the following command:
gcloud feedback

To check gcloud for common problems, please run the following command:
gcloud info --run-diagnostics

Anyone know how to solve this? I searched and set myself with my email address (not a service account) as the owner, so the permission should be there. I just notice that it tried to create an app.yaml file directly under C:\\ instead of the functions-cron folder containing an app.yaml and the cron.yaml file.

Would really appreciate the help!! For additional information, I am using windows..

Upvotes: 1

Views: 320

Answers (2)

LundinCast
LundinCast

Reputation: 9810

It seems indeed that the Cloud SDK is trying to create an app.yaml file, which means there was no app.yaml file in your folder C:\Users\vreee\Firebase\functions-cron\appengine. As per the tutorial you linked, both app.yaml and cron.yaml files should be in that directory when you run the deploy command.

So your options are:

  • If you have already deployed an app and your app.yaml file hasn't changed (i.e it already declares the endpoint for your cron job), you can run the following command from your \functions-cron\appengine folder to upload the cron.yaml file only: gcloud app deploy cron.yaml.
  • Otherwise, you need to have both files within the same folder and run the command gcloud app deploy app.yaml cron.yaml.

Upvotes: 1

Ggrimaldo
Ggrimaldo

Reputation: 327

In order for any Google App Engine deployment to work, a configuration file named "App.yaml" is necessary. There is an article in the official documentation about the possible parameters and configurations.

This issue doesn't looks like related to permissions to write in the cloud, but rather permissions to write in your local machine C:. My advice would be that you create the file before the deployment so gcloud doesn't need to be granted admin permissions to write in your local machine.

Upvotes: 0

Related Questions