microgateway icon indicating copy to clipboard operation
microgateway copied to clipboard

api loader failed to load any api

Open pdhoward opened this issue 8 years ago • 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 avatar Apr 06 '17 18:04 pdhoward

@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

tonyffrench avatar Apr 18 '17 23:04 tonyffrench

Win10

pdhoward avatar Apr 19 '17 13:04 pdhoward

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

kimoudev avatar Jun 04 '17 02:06 kimoudev

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

geekosphere-net avatar Jun 13 '17 14:06 geekosphere-net

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

kimoudev avatar Jun 13 '17 14:06 kimoudev

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

geekosphere-net avatar Jun 13 '17 14:06 geekosphere-net

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 !

Searev avatar Jul 25 '17 12:07 Searev

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.

raghavendranagolu avatar Oct 24 '17 13:10 raghavendranagolu

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

jpegram2 avatar Feb 04 '19 18:02 jpegram2