1

In my app, the app.yaml (the relevant part) looks like this:

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: /logs
  script: logviewer.main.app

- url: /static
  static_dir: static

- url: /(.*\.html)
  static_files: pages/\1
  upload: pages/(.*\.html)

- url: /_ah/spi/.*
  script: api.application

- url: .*
  script: main.app

I've included all handlers, just to make sure, but I'm quite certain that app.yml isn't the problem.

The relevant part of api.py

@endpoints.api(name='quizservice',version='v01',
               description='api backand for quickbuzzer')
class QuizService(remote.Service):


  @endpoints.method(messages.VoidMessage , messages.CreateQuizResponse, name="createQuiz")
  def createQuiz(self, request):
    . . .

application = endpoints.api_server([QuizService],
                                restricted=False)

Now, when I visit the explorer and try running the QuiizService.createQuiz method, I get a 404 back.

Looking at the logs, I see this:

INFO     2013-04-29 17:53:15,560 server.py:561] default: "GET /_ah/api/discovery/v1/apis/quizservice/v01/rest HTTP/1.1" 200 2738
INFO     2013-04-29 17:53:22,118 server.py:561] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 200 1585
WARNING  2013-04-29 17:53:22,119 api_config_manager.py:201] No endpoint found for path: quizservice/v01
INFO     2013-04-29 17:53:22,119 server.py:561] default: "POST /_ah/api/quizservice/v01 HTTP/1.1" 404 9
bigblind
  • 12,539
  • 14
  • 68
  • 123

2 Answers2

3

I was able to solve the issue by supplying a path parameter to the endpoints.method decorator. What I'm wondering now, is if the endpoints api could choose a default path based on my method name.

bigblind
  • 12,539
  • 14
  • 68
  • 123
1

Another case where this error can be thrown is with incorrect order of url handlers declaration. See https://stackoverflow.com/a/15675839/362953

- url: .*
  script: main.app

Should come at the end, not before

- url: /_ah/spi/.*
  script: api.application

In this case of OP the order is correct.

Community
  • 1
  • 1
user362953
  • 435
  • 2
  • 13
  • Could it also be related to Endpoint Frameworks? Seems I only started getting this after upgrading a while back. My particular use case involves unit testing (I know - this is an integration test). – Tom Russell Dec 14 '17 at 21:25