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

MVC module in 404 page causes system to crash on startup #4363

Closed
1 of 2 tasks
miguelvaz78 opened this issue Dec 15, 2020 · 6 comments
Closed
1 of 2 tasks

MVC module in 404 page causes system to crash on startup #4363

miguelvaz78 opened this issue Dec 15, 2020 · 6 comments

Comments

@miguelvaz78
Copy link

miguelvaz78 commented Dec 15, 2020

Description of bug

If you add an MVC module in the 404 page it will not work and will cause all mvc modules to not load if the first hit to the site is to a non existing page.

Affected versions

  • 10.00.00 alpha build
  • 09.08.00 latest supported release

Steps to reproduce

List the precise steps to reproduce the bug:

  1. Edit the 404 page
  2. Add a MVC module to the 404 page - I used the Contact list MVC example.
  3. Navigate to a non existing page. ex: http://dnndev.me/this-page-does-not-exists
  4. The module shows an unable to load error message.

Error information

On step 4 shown above, it is recorded in the log one exception:
Module Load Exception
Message:An error occurred when trying to create a controller of type 'Dnn.ContactList.Mvc.Controllers.ContactController'. Make sure that the controller has a parameterless public constructor.
StackTrace:
InnerMessage:
An error occurred when trying to create a controller of type 'Dnn.ContactList.Mvc.Controllers.ContactController'. Make sure that the controller has a parameterless public constructor.
InnerStackTrace:

   at System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType)
   at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
   at DotNetNuke.Web.Mvc.Framework.Modules.ModuleApplication.ExecuteRequest(ModuleRequestContext context)
   at DotNetNuke.Web.Mvc.MvcHostControl.ExecuteModule()

If you restart the server and the first requests hits the not found page (example above) the MVC system breaks and all mvc modules in any page stop working.
In this case, the system registers the following error when loading the MVC modules. It seams that the startup breaks and some context is not successfully created, that breaks the MVC system.
This is resolved by manually restarting the server and hitting a page that exists.

Message:IServiceScope not provided
StackTrace:
InnerMessage:IServiceScope not provided
InnerStackTrace:

   at DotNetNuke.Web.Mvc.DnnMvcDependencyResolver.GetService(Type serviceType)
   at System.Web.Mvc.DependencyResolverExtensions.GetService[TService](IDependencyResolver resolver)
   at System.Web.Mvc.SingleServiceResolver`1.GetValueFromResolver()
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at System.Web.Mvc.SingleServiceResolver`1.get_Current()
   at System.Web.Mvc.DefaultControllerFactory.get_ControllerActivator()
   at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
   at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
   at DotNetNuke.Web.Mvc.Framework.Modules.ModuleApplication.ExecuteRequest(ModuleRequestContext context)
   at DotNetNuke.Web.Mvc.MvcHostControl.ExecuteModule()

Help is appreciated. Thanks!!

@miguelvaz78 miguelvaz78 changed the title MVC module in 404 page causes system to crach on startup MVC module in 404 page causes system to crash on startup Dec 15, 2020
@jacoch
Copy link
Contributor

jacoch commented Dec 24, 2020

Glad to find that bug report. Was searching for several days what could cause one of our web site to crash sometime. I was sure it has something to do with 404 page, as the web site was replacing an older one and thus having a lot of 404 due to existing links. But did not find the link to MVC module. Will change the page in the meantime to avoid these crashes. Thanks.

@stale
Copy link

stale bot commented Jun 2, 2021

We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically.
If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!

@stale stale bot added the stale label Jun 2, 2021
@modemgeek
Copy link

this is also an issue for us. Is there going to be a fix for this?

@stale stale bot removed the stale label Jun 8, 2021
@stale
Copy link

stale bot commented Sep 6, 2021

We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically.
If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!

@stale stale bot added the stale label Sep 6, 2021
@stale
Copy link

stale bot commented Sep 21, 2021

This issue has been closed automatically due to inactivity (as mentioned 14 days ago). Feel free to re-open the issue if you believe it is still relevant.

@stale stale bot closed this as completed Sep 21, 2021
@jacoch
Copy link
Contributor

jacoch commented Jun 10, 2022

Did someone check a newer version? Is this bug still unresolved? It's quite complicated to explain customers that the mvc modules we wrote can't be used in the 404 error page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants