Can't create cron job in Google App Engine app that has multiple services

414 views
Skip to first unread message

Gudrat Hasanli

unread,
Jan 22, 2017, 1:56:18 PM1/22/17
to Google App Engine

When I deploy my application which has multiple services, I can't see the cron job to be registered in App Engine Console, despite following directory hierarchy described in Configuration files overview .

This is my cron.xml file, which I placed in my default service's WEB-INF directory:


<?xml version="1.0" encoding="UTF-8"?>
<cronentries>
    <cron>
        <url>/cron</url>
        <description>Execute scheduled tasks</description>
        <schedule>every 5 minutes</schedule>
    </cron>
</cronentries>


This is my default service's appengine-web.xml file:


<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <application>default</application>
  <version>1</version>
  <threadsafe>true</threadsafe>

  <sessions-enabled>true</sessions-enabled>

  <manual-scaling>
    <instances>1</instances>
  </manual-scaling>
</appengine-web-app>


My GAE application has 4 services, all defined in application.xml file:


<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
  <display-name>modules-ear</display-name>
  <module>
    <web>
      <web-uri>module-default-1.0</web-uri>
      <context-root>module-default</context-root>
    </web>
  </module>
  <module>
    <web>
      <web-uri>module-1-1.0</web-uri>
      <context-root>module-1</context-root>
    </web>
  </module>
  <!-- declared other modules likewise -->
  <library-directory>lib</library-directory>
</application>


My project structure:

Can you please tell me what am I doing wrong that my cron job doesn't run?

OP on stackoverflow

Blaine Garrett

unread,
Jan 23, 2017, 11:38:49 AM1/23/17
to Google App Engine
Is your default module a standard environment?

The new flex environment doesn't support a variety of things such as the user service, perhaps from as well.


I had issues trying to route /_ah/* URLs to my standard environment service when the default frontend service was the new flex environment. For me, the work around was to make the standard environment default service, and specifically route web traffic to the (now non-default) frontend flex environment.

Jordan (Cloud Platform Support)

unread,
Jan 23, 2017, 12:16:03 PM1/23/17
to Google App Engine
As Google Groups is meant for high level product discussions, I recommend you continue troubleshooting via your original Stack Overflow post. 

Note, in order to have your cron.yaml uploaded, you need to run the proper 'gcloud app deploy cron.yaml' command. This is also true for all other individual yaml files that your project contains, as they must be specifically referenced to be uploaded.  If not specified, it will default to using the app.yaml found in the current directory.
Reply all
Reply to author
Forward
0 new messages