wso2 / api-manager

All issues, tasks, improvements and new features of WSO2 API Manager
Apache License 2.0
34 stars 8 forks source link

404 Not Found After creating new Endpoint #184

Open kyawswar87 opened 2 years ago

kyawswar87 commented 2 years ago

Description

I got 404 Not found issue after creation new endpoint. There is no such issue on H2 db. But when I used Mysql, I got such error.

{
    "code": "404",
    "type": "Status report",
    "message": "Not Found",
    "description": "The requested resource is not available."
}

I need to restart the APIM on every time I create new endpoints to load the new endpoints.

Steps to Reproduce

I just added the Mysql in deployment.toml as below.

[database.shared_db]
type = "mysql"
url = "jdbc:mysql://<host>:3306/shared_db?useSSL=false"
username = "admin"
password = "admin"
pool_options.maxActive = 100
pool_options.maxWait = 10000
pool_options.validationInterval = 10000
driver="com.mysql.jdbc.Driver"

[database.apim_db]
type = "mysql"
url = "jdbc:mysql://<host>:3306/apim_db?useSSL=false"
username = "admin"
password = "admin"
pool_options.maxActive = 100
pool_options.maxWait = 10000
pool_options.validationInterval = 10000
driver="com.mysql.jdbc.Driver"

add into mysql connector jar into ./wso2am-4.1.0/repository/components/lib/mysql-connector-java-5.1.49.jar

Affected Component

APIM

Version

4.1.0

Environment Details (with versions)

OS: CentOS Linux release 7.9.2009 (Core)

uname -r 3.10.0-1160.62.1.el7.x86_64

Relevant Log Output

TID: [-1234] [] [2022-06-13 13:40:52,465] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 >> GET /mail HTTP/1.1
TID: [-1234] [] [2022-06-13 13:40:52,466] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 >> User-Agent: PostmanRuntime/7.29.0
TID: [-1234] [] [2022-06-13 13:40:52,466] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 >> Accept: */*
TID: [-1234] [] [2022-06-13 13:40:52,466] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 >> Cache-Control: no-cache
TID: [-1234] [] [2022-06-13 13:40:52,466] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 >> Postman-Token: 43a3c10
TID: [-1234] [] [2022-06-13 13:40:52,466] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 >> Host: xxxxxx:8243
TID: [-1234] [] [2022-06-13 13:40:52,466] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 >> Accept-Encoding: gzip, deflate, br
TID: [-1234] [] [2022-06-13 13:40:52,466] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 >> Connection: keep-alive
TID: [-1234] [] [2022-06-13 13:40:52,467]  INFO {org.apache.synapse.mediators.builtin.LogMediator} - STATUS = Message dispatched to the main sequence. Invalid URL., RESOURCE = /mail, HEALTH CHECK URL = /mail
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 << HTTP/1.1 404 Not Found
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 << activityid: b66e8aa1-9e38-49c656d7df44
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 << Cache-Control: no-cache
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 << Postman-Token: 43a3c101-02b0-46e4-ade7-58e37f0f31a8
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 << Accept-Encoding: gzip, deflate, br
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 << Content-Type: application/json; charset=UTF-8
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 << Date: Mon, 13 Jun 2022 07:10:52 GMT
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 << Transfer-Encoding: chunked
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-208 << Connection: keep-alive
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "HTTP/1.1 404 Not Found[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "activityid: b66e8aa1-bd33-4c9a-9e38-49c656d7df44[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "Cache-Control: no-cache[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "Postman-Token: 43a3c101-58e37f0f31a8[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "Accept-Encoding: gzip, deflate, br[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "Content-Type: application/json; charset=UTF-8[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "Date: Mon, 13 Jun 2022 07:10:52 GMT[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "Transfer-Encoding: chunked[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "Connection: keep-alive[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "74[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "{"code":"404","type":"Status report","message":"Not Found","description":"The requested resource is not available."}[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "0[\r][\n]"
TID: [-1234] [] [2022-06-13 13:40:52,467] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-4 << "[\r][\n]"

Related Issues

No response

Suggested Labels

Affected/APIM-4.1.0

kyawswar87 commented 2 years ago

I used mysql version 5.7.29

kyawswar87 commented 2 years ago

Now I found the root cause of the error. Because I got the JMS error as following

[2022-06-14 13:00:40,846] ERROR - AMQConnection Throwable Received but no listener set. org.wso2.andes.AMQDisconnectedException: Server closed connection and reconnection not permitted. at org.wso2.andes.client.protocol.AMQProtocolHandler.closed(AMQProtocolHandler.java:274) ~[andes_3.3.23.jar:?] at org.wso2.andes.transport.network.mina.MinaNetworkHandler.sessionClosed(MinaNetworkHandler.java:150) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.sessionClosed(AbstractIoFilterChain.java:548) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain.callNextSessionClosed(AbstractIoFilterChain.java:267) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain.access$800(AbstractIoFilterChain.java:51) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.sessionClosed(AbstractIoFilterChain.java:631) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:65) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain.callNextSessionClosed(AbstractIoFilterChain.java:267) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain.access$800(AbstractIoFilterChain.java:51) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.sessionClosed(AbstractIoFilterChain.java:631) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:230) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264) ~[andes_3.3.23.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_322] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_322] at org.wso2.org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51) ~[andes_3.3.23.jar:?] at java.lang.Thread.run(Thread.java:750) [?:1.8.0_322] [2022-06-14 13:00:40,846] ERROR - JMSListener JMS Provider is not yet started. Please start the JMS provider now. [2022-06-14 13:00:40,846] ERROR - JMSListener Connection attempt : 3 for JMS Provider failed. Next retry in 80 seconds [2022-06-14 13:00:40,847] ERROR - JMSListener JMS Provider is not yet started. Please start the JMS provider now. [2022-06-14 13:00:40,847] ERROR - JMSListener Connection attempt : 3 for JMS Provider failed. Next retry in 80 seconds [2022-06-14 13:00:40,861] ERROR - AMQConnection Throwable Received but no listener set. org.wso2.andes.AMQDisconnectedException: Server closed connection and reconnection not permitted. at org.wso2.andes.client.protocol.AMQProtocolHandler.closed(AMQProtocolHandler.java:274) ~[andes_3.3.23.jar:?] at org.wso2.andes.transport.network.mina.MinaNetworkHandler.sessionClosed(MinaNetworkHandler.java:150) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.sessionClosed(AbstractIoFilterChain.java:548) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain.callNextSessionClosed(AbstractIoFilterChain.java:267) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain.access$800(AbstractIoFilterChain.java:51) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.sessionClosed(AbstractIoFilterChain.java:631) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:65) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain.callNextSessionClosed(AbstractIoFilterChain.java:267) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain.access$800(AbstractIoFilterChain.java:51) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.sessionClosed(AbstractIoFilterChain.java:631) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:230) ~[andes_3.3.23.jar:?] at org.wso2.org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264) ~[andes_3.3.23.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_322] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_322] at org.wso2.org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51) ~[andes_3.3.23.jar:?] at java.lang.Thread.run(Thread.java:750) [?:1.8.0_322] [2022-06-14 13:00:40,861] ERROR - JMSListener JMS Provider is not yet started. Please start the JMS provider now. [2022-06-14 13:00:40,861] ERROR - JMSListener Connection attempt : 3 for JMS Provider failed. Next retry in 80 seconds [2022-06-14 13:00:40,874] ERROR - JMSListener JMS Provider is not yet started. Please start the JMS provider now. [2022-06-14 13:00:40,874] ERROR - JMSListener Connection attempt : 3 for JMS Provider failed. Next retry in 80 seconds

I ignored this error and tried to create new endpoints. And the APIM response 404 for this new endpoint.

Solution: I tried to solve for JMS ERROR as following. https://stackoverflow.com/questions/70638927/wso2-apim-4-jms-provider-is-not-yet-started

I changed my admin password without including '@' character. And this JMSListener ERROR is gone.

And 404 Not found error is solved now. I don't need to restart APIM server after create new endpoint.

Thanks.

github-actions[bot] commented 2 years ago

This issue is NOT closed with a proper Resolution/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Resolution/Cannot Reproduce - Issue cannot be reproduced.
      - Resolution/Duplicate - Issue is already reported before.
      - Resolution/Fixed - Issue has already been fixed.
      - Resolution/Answered - Issue has already been answered.
      - Resolution/Invalid - Issue is invalid.
      - Resolution/Not a bug - Issue is not a bug.
      - Resolution/Postponed - Issue is postponed.
      - Resolution/Won’t Fix - Issue won't be fixed.

kyawswar87 commented 2 years ago

Resolution/Not a bug

github-actions[bot] commented 2 years ago

This issue is NOT closed with a proper Resolution/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Resolution/Cannot Reproduce - Issue cannot be reproduced.
      - Resolution/Duplicate - Issue is already reported before.
      - Resolution/Fixed - Issue has already been fixed.
      - Resolution/Answered - Issue has already been answered.
      - Resolution/Invalid - Issue is invalid.
      - Resolution/Not a bug - Issue is not a bug.
      - Resolution/Postponed - Issue is postponed.
      - Resolution/Won’t Fix - Issue won't be fixed.

kyawswar87 commented 2 years ago

Resolution/Not a bug

github-actions[bot] commented 2 years ago

This issue is NOT closed with a proper Resolution/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Resolution/Cannot Reproduce - Issue cannot be reproduced.
      - Resolution/Duplicate - Issue is already reported before.
      - Resolution/Fixed - Issue has already been fixed.
      - Resolution/Answered - Issue has already been answered.
      - Resolution/Invalid - Issue is invalid.
      - Resolution/Not a bug - Issue is not a bug.
      - Resolution/Postponed - Issue is postponed.
      - Resolution/Won’t Fix - Issue won't be fixed.

kyawswar87 commented 2 years ago

Resolution/Not a bug - Issue is not a bug.

github-actions[bot] commented 2 years ago

This issue is NOT closed with a proper Resolution/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Resolution/Cannot Reproduce - Issue cannot be reproduced.
      - Resolution/Duplicate - Issue is already reported before.
      - Resolution/Fixed - Issue has already been fixed.
      - Resolution/Answered - Issue has already been answered.
      - Resolution/Invalid - Issue is invalid.
      - Resolution/Not a bug - Issue is not a bug.
      - Resolution/Postponed - Issue is postponed.
      - Resolution/Won’t Fix - Issue won't be fixed.