strongloop/microgateway

api loader failed to load any api

pdhoward opened this issue · 9 comments

I appreciate the open source, and look forward to exercising this project/platform

I don't have a lot of time right now to dig into the code, so thought I'd post the issue encountered here, hoping you can point me in the right direction

  1. followed installation instructions and test below, including definition of yaml file in definitions/sample
  2. node sample.js appears to start-up correctly, issuing 2 warnings on deprecated context middleware
  3. curl http://localhost:3000/sample/echo -- and receive message {"name": "PreFlowError". "message": "unable to process the request"}
  4. message in cli displays "Error: api-loader failed to load any API"
  5. not sure if it is important, but i did note in the .datastore file that the following record is stored
    {"snapshot":"C:\Users\Patrick\Desktop\microgateway\test/definitions/sample","port":36042}

@pdhoward I've completed "Getting Started" instructions on my mac and it worked flawlessly. What Windows version do you use?

tonyf-mbp-ibm:apim-clean tonyf$ curl -v http://localhost:3000/sample/echo
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3000 (#0)
> GET /sample/echo HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: IBM API Connect MicroGateway
< access-control-allow-origin: *
< access-control-allow-credentials: false
< access-control-allow-headers:
< access-control-allow-methods: GET,OPTIONS
< access-control-expose-headers: APIm-Debug-Trans-Id, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Global-Transaction-ID
< Host: localhost:3000
< User-Agent: curl/7.51.0
< Accept: */*
< X-RateLimit-Limit: 100
< X-RateLimit-Remaining: 99
< Content-Length: 22
< Date: Tue, 18 Apr 2017 23:27:07 GMT
< Connection: keep-alive
<
* Curl_http_done: called premature == 0
* Connection #0 to host localhost left intact

Win10

I have this error
Error: api-matcher failed to match to any API
I did exactly as indicated..i'm on mac.
help please @tonyffrench

I get the same error when running in CentOS 7
In Step 3 it says to go to the root folder which is the same folder as Step 2 and when I create the sample.js file there, the require for the microgw fails as it is not in "../lib/microgw" but "./lib/microgw"
after changing that I still have the same "failed to load any API" error

Exactly @geekosphere-net in MAC/CENTOS7 same error... @ozairs

npm test fails as well so not sure it is due to problems with the script.js or sample_1.0.0.yaml code.

I recently encountered a similar problem. The microgateway used to work just fine, but these days, any new install would end up displaying an api-loader failed to load any API error message for any request (on Windows 7, 10, CentOS 6).
I found out that the problem came from one of the dependencies, loopback-datasource-juggler, which has been upgraded from 2.54.1 to 2.55.1.
I resolved the problem specifying the package version in the package.json file

{
    // other fields
    "dependencies": {
        // other dependencies
        "loopback-datasource-juggler": "2.54.1"
    },
    "APIConnectGateway": "1.0.0"
}

I hope it can help some of you !

Hi All,

I am also getting the same error '{"name":"PreFlowError","message":"unable to process the request"}' ,exact resolution has not yet identified for this problem. Can anyone please help me on this.

May be a moot point but this is still an issue.