dnnsoftware / Dnn.Platform

DNN (formerly DotNetNuke) is the leading open source web content management platform (CMS) in the Microsoft ecosystem.
https://dnncommunity.org/
MIT License
1.02k stars 745 forks source link

Showstopper: 9.4 after upgrading I am no longer able to edit module settings #2993

Closed thabaum closed 5 years ago

thabaum commented 5 years ago

Description of bug

Something is very off with the edit module settings. On two instances of DNN one that is pretty bare and one with a load of modules... both same issue once you click on Edit Settings one a module on a page the popup window for editing the settings of a module such as permissions does not work.

Default.aspx?tabid=96&error=Sequence+contains+more+than+one+matching+element

Steps to reproduce

List the steps to reproduce the behavior:

  1. Upgrade or possibly just install DNN 9.4
  2. Click on Edit Settings on any module on a page with edit mode
  3. Bugs out the website
  4. Test on many pages popup never opens... See error

Current result

Edit module settings window popup errors out. Default.aspx?tabid=39&error=Sequence+contains+more+than+one+matching+element

Message:Sequence contains more than one matching element

StackTrace:

InnerMessage:Sequence contains more than one matching element AbsoluteURL:/Default.aspx DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke ExceptionGUID:88e591f2-0a59-4ab2-a3d2-954cd48d31c9 AssemblyVersion:9.4.0 PortalId:0 UserId:1 TabId:39 RawUrl:/Forum/ctl/Module/ModuleId/409?ReturnURL=/Forum&popUp=true InnerStackTrace:

at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate) at DotNetNuke.Web.UI.WebControls.Internal.DnnComboBox.RegisterRequestResources() at DotNetNuke.Web.UI.WebControls.Internal.DnnComboBox.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Affected browser

RFHavens commented 5 years ago

I too get the same error on a test site.
Upgraded from 9.3.2 to 9.4.0 without issues. Edit content of basic HTML module no problem. Edit Settings to change title or permissions of the module and throws and error. Also tried to edit settings from pages and get the same results.

valadas commented 5 years ago

I did not experience that issue, is there anything out of the ordinary that could point to the right direction, does it happen with the default skin? Was the hosting environment updated for .Net 4.7.2, etc. anything out of the ordinary? Localization? Non-default modules installed, etc.?

Also, can you guys check the logs in both the UI event log and in Portals_default\logs for other hints...

TopCat6 commented 5 years ago

I get the same error after upgrading from 9.3.2 to 9.4.0. After clicking the settings gear I get a red banner saying "A critical error has occurred. Please check the Event Viewer for further details." The Event Viewer shows the same error as thabaum showed above. Portals_default\logs shows several errors, such as: System.IO.FileNotFoundException: Could not load file or assembly 'Dnn.PersonaBar.Pages' or one of its dependencies. The system cannot find the file specified. File name: 'Dnn.PersonaBar.Pages' [ERROR] Dnn.PersonaBar.Library.Controllers.PersonaBarController - System.ArgumentNullException: Value cannot be null. [ERROR] DotNetNuke.Framework.Reflection - Dnn.PersonaBar.Licensing.MenuControllers.HostMenuController, Dnn.PersonaBar.Licensing System.IO.FileNotFoundException: Could not load file or assembly 'Dnn.PersonaBar.Licensing' or one of its dependencies. The system cannot find the file specified. I'll attach the log file.

2019.09.15.log.resources.txt

thabaum commented 5 years ago

I currently have latest updates, it happens on default site, default theme, I only have a couple modules installed but I nothing really in use.

Seems to be something with the popup however as it did pop up once for me but never with the settings displayed and then it closes.

It is odd as it is like it is something inside the popup page being rendered makes the site refresh pretty much with an error as soon as the popup starts to load so something at the beginning.

thabaum commented 5 years ago

I was trying to edit permissions as I seen the persmissions for a module had either changed or something for members as the members on a site showed up when browsing and not logged in.

I wanted to check permissions on the module and set it for only registered users... this could be issue possibly with settings and not the page loading of the popup.

It almost feels like the permissions are not working right. But it may just be a hunch but on the side of security worth further investigating.

thabaum commented 5 years ago

Odd, I was logged in as admin, clicked edit settings, popup window popped up asking me to log in again, so I did, and it pretty much crashed the website 500 error.

thabaum commented 5 years ago

Message:Sequence contains more than one matching element

StackTrace:

InnerMessage:Sequence contains more than one matching element

InnerStackTrace:

at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate) at DotNetNuke.Web.UI.WebControls.Internal.DnnComboBox.RegisterRequestResources() at DotNetNuke.Web.UI.WebControls.Internal.DnnComboBox.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

thabaum commented 5 years ago

RawUrl:/Forum/ctl/Module/ModuleId/409?ReturnURL=/Default.aspx?tabid=39&error=Sequence%20contains%20more%20than%20one%20matching%20element&popUp=true

Referrer:https://www.p.com/Login?returnurl=%2fDefault.aspx%3ftabid%3d39%26error%3dSequence%2bcontains%2bmore%2bthan%2bone%2bmatching%2belement

UserAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0

ExceptionHash:QoYgy72mYm/VjpO4j5ksJUKaoXw=

Message:Sequence contains more than one matching element

StackTrace:

InnerMessage:Sequence contains more than one matching element

InnerStackTrace:

at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate) at DotNetNuke.Web.UI.WebControls.Internal.DnnComboBox.RegisterRequestResources() at DotNetNuke.Web.UI.WebControls.Internal.DnnComboBox.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

thabaum commented 5 years ago

two errors on Admin log that are new... and the fact it made me log in on my super account I was already logged in under.

image

thabaum commented 5 years ago

notice i logged in twice... when I only logged in once and before I could have hit the edit settings. then the errors after making me log in a second time.

thabaum commented 5 years ago

My God, I look at the logs in the log.resources file and it is massive personabar, i mean like wow man.

It relates to pretty much a lot of the issues being reported all of these... I will clean it up and try to post it but might be best a file?!

thabaum commented 5 years ago

dnndefaultlog.txt There is the site log Though I see a few due to timeouts... this site is currently hosted with SQL 2014 server which is fairly old compared to azure or an SSD workstation possibly.

However looking further into the logs a number of "cannot be null" issues for the persona bar. Some may relate to this issue as well. Other than this so far the site runs great for general browsing. Hope it helps.

TopCat6 commented 5 years ago

I just searched through the website files and could not find a file with the name 'Dnn.PersonaBar.Pages', which the error messages say that DNN cannot find either: The system cannot find the file specified. File name: 'Dnn.PersonaBar.Pages' I did find a bunch or resource files with that name in the website\appdata folder, such as the latest one from May: PersonaBar_Dnn.PersonaBar.Pages_2.0.1.resources but that's all. Nothing in the bin folder. Looking in an old 9.3.2 version bin folder I found: Dnn.PersonaBar.Pages.dll Looking in the file 'DNN_Platform_9.4.0_Upgrade.zip', that file is not there (should be in install\modules) So, it looks to me like the PersonaBar got completely refactored in 9.4, since the upgrade/install zip in the previous versions had 22 zip files for the PersonaBar, but in 9.4 there are only 2 files (located in install\modules folder in the install zip). I'm guessing the old approach used Dnn.PersonaBar.Pages.dll and the new approach uses 'Dnn.PersonaBar.UI.dll' and someone didn't update some calls to reflect the new approach. Or, if they did update them, they failed to get included in the update package.

valadas commented 5 years ago

Ok, a little insight on this, I did a couple upgrades and only one had this issues and it was an upgrade from a very old Dnn like 5.x.x

The persona bar in 9.4 was rewritten so that all extensions backend code now lives in a single dll instead of one dll per extension, so during upgrade it should delete the old dlls like Dnn.PersonaBar.Pages.dll and there should be only (I think 3) dlls, the extensions code now lives in Dnn.PersonaBar.Extensions.dll for all extensions. At the same time, during the upgrade the persona bar modules should get unregistered and a single Extensions persona bar module should stay with version 3.0.0...

Can you guys check in the extensions module, select PersonaBar in the dropdown and check what is listed there, in my case manually un-registering the old ones and keeping only the Extensions one fixed the issue. Can you confirm you are experiencing the same issue ?

thabaum commented 5 years ago

I will check this when I can if I understand correctly. Maybe everything needs reinstalled but one of my installations is a version 9 starting version. The other might be 8. But it does seem like something was odd with the persona bar needing reinstalled on some version in the past. Is there a way to easily download and repair install the persona bar. Im still pretty fresh to how to work with it outside of normal user use.

valadas commented 5 years ago

Yes you can op n the dnn package zip and extract individual modules from install/module then you can install just those using the normal modules installer in the extensions module

dbmadison commented 5 years ago

I don't think the persona bar issues are related to the module setting panel load issues. I've followed valadas's instructions above to unregister and repair the persona bar. That fixed a different issue that I was having in 9.4 after upgrading from 9.32 (https://dnncommunity.org/forums/aft/317).

It didn't fix the module settings issue.

bdukes commented 5 years ago

Looks like the SingleOrDefault bug comes from requesting the Selectize library and assuming there will always be one version of it: https://github.com/dnnsoftware/Dnn.Platform/blob/584b0f54bd6b6d237594dd9f96053f14db0b1a53/DNN%20Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnComboBox.cs#L251

As a workaround, go into the Extensions page of the Persona Bar, switch type to JavaScript Library in the Showing: (i.e. extension type) drop down, and uninstall the Selectize JavaScript Library entry with the lower version.

bdukes commented 5 years ago

Actually, you can't uninstall it by default because it's a "system" package, so run this SQL:

UPDATE Packages 
SET IsSystemPackage = 0
WHERE PackageID = (SELECT TOP 1 PackageID FROM JavaScriptLibraries WHERE LibraryName = 'Selectize' ORDER BY Version)

Then clear the cache (in Servers page of Persona Bar). Finally, you can now uninstall the library via Extensions

TopCat6 commented 5 years ago

@valadas There are 20 extensions in PersonaBar for version 2.0.1, one for version 3.0.0 (.Extensions), and one for 1.0.2 (Peter Donker's UserAccess PersonaBar). The bin folder has 3 dlls as you stated: .Extensions, .Library and .UI . I will uninstall all the 2.0.1 versions and see what happens. Then I'll run the SQL and delete the old Selectize package.

dbmadison commented 5 years ago

The fix suggested by bdukes worked for me. Thank you!

There were two instances of the Selectize JavaScript library registered for me (v0.12.4 and v0.12.6). I ran the SQL above to make the first one able to be uninstalled and then uninstalled the oldest one (v0.12.4). That left only one: v0.12.6. I then refreshed the cache again. I am now able to enter the module settings.

TopCat6 commented 5 years ago

Ok, that worked! Thank you, guys. For any others experiencing this, here's what happened... I used the Extensions module on the PersonaBar and selected PersonaBar. Then deleted all the 2.0.1 versions that had a trashcan icon. Two did not, .Scheduler and .Themes. I reinstalled/repaired three extensions from the 9.4 Upgrade zip file: DNN.PersonaBar.Extensions, DNN.PersonaBar.UI and DNN.EditBar.UI. That last one was just for good measure because @dbmadison said in the community forum that he linked to above that the Edit Bar no longer worked when he did the PersonaBar process. I then ran the SQL above and was able to delete the older Selectize module in Extensions. I cleared cache and recycled the app pool and was able then to delete the two remaining PersonaBar modules with version 2.0.1.

I did not know about having to upgrade 2sxc to 10.5 before upgrading DNN to 9.4, so I am wondering if this was a factor in causing this issue. It was using an old version of Microsoft.Extensions.DependencyInjection. https://dnncommunity.org/forums/aft/312

thabaum commented 5 years ago

Bravo!

valadas commented 5 years ago

I am closing this issue in favor of two other ones that target the selectize and the persona bar issue: https://github.com/dnnsoftware/Dnn.Platform/pull/2996 https://github.com/dnnsoftware/Dnn.AdminExperience/issues/1163

ChrisHammond commented 4 years ago

I'm seeing this in a 932 instance as well??? Not sure how it just started happening there.

valadas commented 4 years ago

@ChrisHammond if you are experiencing this issue on 9.3.2 you probably have a different issue. This one was two upgrade issues with 9.4.0, can you upgrade to 9.4.1, retest an then report back as a new issue with some logs if you are still having troubles?

ChrisHammond commented 4 years ago

@valadas some how my Dev instance on 932 had persona bar 941 installed..... Not sure how. But it was definitely this issue

valadas commented 4 years ago

Ha, then yeah, something is not normal there having 9.4.1 persona bar on 9.3.2 dnn... :)