0
votes

I was working on google Pubsub with App Engine, to get notifications from google play about InApp subscriptions status.

When I deploy my app with the command "gcloud app deploy", error message comes:

ERROR: (gcloud.app.deploy) An error occurred while parsing file: [/home/testaccount/php-docs-samples/pubsub/app/app.yaml] Unable to assign value 'pubsub.js' to attribute 'url': Value 'pubsub.js' for url does not match expression '^(?:(?!^)/.|..|((.).*(?!$).)$' in "/home/testaccount/php-docs-samples/pubsub/app/app.yaml", line 6, column 8

My app.yaml file:

runtime: php55
api_version: 1
threadsafe: true

handlers:
- url: pubsub.js
  static_files: pubsub.js
- url: /.*
  script: index.php

env_variables:
  GOOGLE_PROJECT_ID: "testproject"

I have followed the insturctions in the linl: Writing and Responding to Pub/Sub Messages

I did not modify app.yaml file, I do not know what is going on? I tried to deploy "Hello, World!" for PHP on App Engine" exmaple and it worked.

Please help me to solve it.

2

2 Answers

1
votes

url should start with a slash. Try:

- url: /pubsub.js
  static_files: pubsub.js
1
votes

After a week searching about why I get HTTP error 500 (Internal Server Error) when I browse https://testproject.uc.r.appspot.com/, I got the reason, it was from app.yaml file, all errors came from php version.

Old app.yaml:

runtime: php55
api_version: 1
threadsafe: true

handlers:
- url: /pubsub.js
  static_files: pubsub.js
  upload: pubsub.js
- url: /.*
  script: index.php

env_variables:
  GOOGLE_PROJECT_ID: "testproject"

New app.yaml:

runtime: php72

handlers:
- url: /pubsub.js
  static_files: pubsub.js
  upload: pubsub.js
- url: /.*
  script: auto

env_variables:
  GOOGLE_PROJECT_ID: "testproject"

Thank God.