Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIM Server Startup Incomplete Due to Internal/Data/V1 Invocations Failing with 404 HTTP Status Code #3297

Open
sajith-madhusanka opened this issue Oct 23, 2024 · 0 comments · May be fixed by wso2/carbon-apimgt#12692

Comments

@sajith-madhusanka
Copy link

sajith-madhusanka commented Oct 23, 2024

Description

The server startup is failing due to a 404 HTTP error from invocations of the internal/data/v1 service. The issue occurs because the startup process, which should be managed by the Equinox Container thread, is instead handled by a default Java thread. As a result, the Tomcat server startup and APIM component initialization run on the same thread. Since some APIM components rely on internal invocations that pass through the Tomcat server, but the Tomcat StandardEngine is stuck in the 'STARTING_PREP' state and unavailable, these internal calls fail with 404 errors. This causes delays in APIM component initialization, leading to the server startup thread getting stuck in a deadlock.

The server startup is not handled by the Equinox Container thread because OSGi framework events, which are responsible for initializing the APIM components, are not being processed properly. This issue could be caused by one of the following reasons:

  • OSGi components not being initialized correctly.
  • Resource Exhaustion
  • Security Permissions

Steps to Reproduce

  • Obtain the latest update level (117) of the APIM 4.2.0 pack.
  • Run the following two commands inside the APIM_HOME/repository/deployment/server/webapps directory to build the UIs (use the node -v 20):
npm install
npm run bootstrap
  • Please make sure that the node_modules folders are created in the webapps directory, as well as in the publisher and devportal directories.
  • Start the APIM server

Affected Component

APIM

Version

4.2.0

Environment Details (with versions)

No response

Relevant Log Output

[2024-10-21 12:29:38,009] ERROR - APIUtil Failed to retrieve /internal/data/v1/application-key-mappings from remote endpoint: Error while retrieving /internal/data/v1/application-key-mappings. Received response with status code 404. Retry attempt 1 in 15 seconds.
[2024-10-21 12:29:38,009] ERROR - APIUtil Failed to retrieve /internal/data/v1/subscriptions from remote endpoint: Error while retrieving /internal/data/v1/subscriptions. Received response with status code 404. Retry attempt 1 in 15 seconds.
[2024-10-21 12:29:38,009] ERROR - APIUtil Failed to retrieve /internal/data/v1/apis from remote endpoint: Error while retrieving /internal/data/v1/apis. Received response with status code 404. Retry attempt 1 in 15 seconds.
[2024-10-21 12:29:38,009] ERROR - APIUtil Failed to retrieve /internal/data/v1/subscription-policies from remote endpoint: Error while retrieving /internal/data/v1/subscription-policies. Received response with status code 404. Retry attempt 1 in 15 seconds.
[2024-10-21 12:29:38,010] ERROR - APIUtil Failed to retrieve /internal/data/v1/application-policies from remote endpoint: Error while retrieving /internal/data/v1/application-policies. Received response with status code 404. Retry attempt 1 in 15 seconds.
[2024-10-21 12:29:38,010] ERROR - APIUtil Failed to retrieve /internal/data/v1/api-policies from remote endpoint: Error while retrieving /internal/data/v1/api-policies. Received response with status code 404. Retry attempt 1 in 15 seconds.
[2024-10-21 12:29:38,010] ERROR - APIUtil Failed to retrieve /internal/data/v1/applications from remote endpoint: Error while retrieving /internal/data/v1/applications. Received response with status code 404. Retry attempt 1 in 15 seconds.
[2024-10-21 12:29:39,601]  WARN - CorrelationConfigManager Failed retrieving correlation configs. Retrying after 4 seconds...
[2024-10-21 12:29:41,599]  WARN - KeyManagerConfigurationDataRetriever Failed retrieving Key Manager Configurations from remote endpoint. Retrying after 16 seconds...
[2024-10-21 12:29:43,608]  WARN - CorrelationConfigManager Failed retrieving correlation configs. Retrying after 8 seconds...
[2024-10-21 12:29:51,616]  WARN - CorrelationConfigManager Failed retrieving correlation configs. Retrying after 16 seconds...
[2024-10-21 12:29:53,019] ERROR - APIUtil Failed to retrieve /internal/data/v1/applications from remote endpoint: Error while retrieving /internal/data/v1/applications. Received response with status code 404. Retry attempt 2 in 30 seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant