-
Notifications
You must be signed in to change notification settings - Fork 16
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
The Node.JS application failed to respond within the given startup time #73
Comments
I have the same issue - I was able to to run the front-end part with the command that back-end is trying to execute
and it runs successfully, however returns 404, that's why the back-end reports My best guess is that something have changed with Content Delivery API integration, but haven't been able to pin-point the exact issue. |
/Hopefully this helps resolve the issue I ran the frontend locally on http://localhost:3000 which means that the CMS should be http://localhost:8000 (not 8001). The issue I encounter after that is that the site/{id}/routes return paths with https://localhost:8001/ and then the resolveRoute function uses the href which is using So if you modify the ContentDeliveryAPI resolveRoute function from using href to pathname it will find the page. Not sure if this will break OPE or not as I haven't tested that yet...
Another solution would also be if your frontend ran by default using https maybe. Update: I ran the frontend after starting the backend using the suggestion from @karolberezicki in frontend/package.json you have the script which you can run: This is what I get when clicking preview so probably need to add additional configuration for it to work which I haven't yet gotten to... |
Hi everyone!
I encountered an error while deploying the project:
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.ApplicationException: The Node.JS application failed to respond within the given startup time
at HeadlessCms.Infrastructure.NodeJsMiddleware.NodeJsProcess.WhenReady(CancellationToken cancellationToken) in D:\Projects\Optimizely\FoundationSpaReact\Foundation-spa-react\src\Headless.Cms\Infrastructure\NodeJsMiddleware\NodeJsProcess.cs:line 92
at HeadlessCms.Infrastructure.NodeJsMiddleware.NodeJsMiddleware.InvokeAsync(HttpContext context) in D:\Projects\Optimizely\FoundationSpaReact\Foundation-spa-react\src\Headless.Cms\Infrastructure\NodeJsMiddleware\NodeJsMiddleware.cs:line 56
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
I get this error when I run the Headless.Cms project (back-end part).
I followed the instructions for deploying the backend and frontend as described in the Readme file.
Backend part:
On the backend side, I successfully executed the commands from point 1.2. Installation. I changed the data in the appsettings.json file in accordance with paragraph 1.3. Service configuration. After that, I decided to launch the site, and, as written in the documentation, the content began to load (I understood this because additional tables began to be created in the database and content was loaded into them). After the content download was completed, I launched the site at this address https://localhost:8001/ - I successfully logged in and checked that there were many content pages in the content tree. I also checked that my user has the 2 required roles WEBADMINS and ADMINISTRATORS in accordance with paragraph 2.1. Configure user accounts. And the last step in setting up the backend was changing the NodeJsMiddleware section in the appsettings.json file, namely, I set port 3000 to listen to the frontend and “Disabled”: “false” to run a JavaScript based frontend as child process of the .Net webserver, as well as several other options in this section.
Frontend part:
Everything is much simpler here - I successfully completed the entire sequence of commands, including changing the site ID in the "OPTIMIZELY_DXP_SITE_ID" parameter.
And this is what I have as a result:
Backend - home page doesn't load (in the backend console i've the same issue):
Frontend console:
Frontend website with 404 error:
EPiServer works correctly and we see the content, but due to the same error we cannot view it:
We see that the frontend is trying to get some data from this URL https://localhost:8001/ but due to a backend error it cannot be done and the frontend side (http://localhost:3000/) does not load the site content.
Also I have a question, is setting up OpenID Connect a requirement? In particular, I am interested in the relevance of setting point 3.2. Applications.
I will be very glad to receive some advice to help launch this headless solution, it seems like some final piece is missing. Thanks for any help.
@remkoj
The text was updated successfully, but these errors were encountered: