EPiServer: A site with siteId is already registered - episerver

My EPiServer application is throwing following error:
A site with siteId is already registered. Call the Reset method firs.
There were no code changes before the exception occurred and there is duplicate of this instance which is running without any problems.
My first try was the most obvious, to change the site id in web.config to something else. This did not help. However changing the configuration restarted application and after refreshing the page it shown another exception:
This slave site failed when validating master license information
After another refresh, third exception appeared:
ClassFactory not initialized
Following refreshes bring back original exception about duplicated site id.
I have no idea what could happen. Searching in google did not bring any results. Every restart of the application (through iisreset or by configuration change) causes the site to throw all those three exceptions, always in the same order: license, class factory, and until next restart duplicated site id.
I will be very grateful for any help that could lead me to the solution.
EDIT: I am using EPiServer 5
EDIT 2: I am now pretty sure that "A site with siteid ..." exception is not relevant here. It is just a consequence of previous fail.
This is what is happening basing on exceptions (it does not seem very logical, but well):
IIS is started
Application reaches static initializer and tries to validate the master license. It fails, exception is thrown and the site is not yet registered (in the database there is no entry made in tblSiteConfig)
The page is refreshed
Application reaches static initializer and successfully validates the license, the site is then registered, the code goes further and fails on plugin initialization method (class factory not initialized)
The page is refreshed
Application reaches static initializer and again successfully validates the license, the site fails because it was already registered
Step 6 is happening until next IIS restart

According to messages, is looks like you are using EPiServer Multisite feature.
First thing to check are /sites/site sections of episerver.config - they should contain different siteId attribute.
Next, in episerver.framework.config file, clear siteHostMapping section, so it should be completely empty:
<siteHostMapping />
Then, start sites one by one.
Possible cause to issue is exception during site startup - so you can still experience similar or the same issue if these errors won't be fixed. Be sure to turn on logging and examine logs.

After you've changed the siteId you need to clear some tables in the database. I don't have a EPi5-database at hand but I recall it's at least tblSite.

Related

How to get 2sxc site registered for Patrons?

I have 2sxc installed on a site. It was previously registered with the Patrons tokens for Core+, Patron Basic, and Patron Perfectionist.
I patched from 13.10.1 to 14.1.0. Now I get this error on all of my apps:
Warning: Registration is Invalid. Some features may be disabled because of this. Please reactivate the registration in Apps Management.
Under System, even though I tried re-registering my app by deleting the old one and starting a new one, I still see "Registered to: (unregistered)"
I went to reactivate my license but it doesn't make a difference. When I go to Extensions/Features, it shows as "Core (free for everyone)" 4/4 but nothing else.
I tried clicking "Retrieve license" but that doesn't seem to make a difference.
How can I register my app to get rid of this error message?
Sorry for the still clumsy process. We'll try to optimize ASAP.
The warning appeared because a major upgrade changes the fingerprint, so the previous activation is invalid. You will need to register the new fingerprint for things to work again.
On features-tab, just click on register and go through the normal steps to activate that fingerprint.

Error on fresh DNN 7.4.2 installation

Some days ago an error occured on my DNN 7 development website (main portal) and did not go away. The portal was set up with DNN 7.0.0, and has been updated to 7.4.2 in several steps (or, let's say, whenever a new DNN 7 version was released). It was running fine, but suddenly this error appeared (there was only a a text saying "DNN Error" and "An unhandeld error has occured", and a button labeled "Return to Site"). I had a sub-portal on this installation which was working fine, but the main portal did not start. As I could not find the reason for this error I decided to delete the installation and set it up from scratch.
I also deleted the database and created a new one, I assigned the permissions and the installation went thru smoothly. I started the web site, everything looked fine. But when I tried to add a new page, I got the following error:
Error: is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Could not load type 'Dnn.Modules.Tabs.ManageTabs'. ---> System.Web.HttpParseException: Could not load type 'Dnn.Modules.Tabs.ManageTabs'. ---> (etc.)
Whatever I do fires an exception like that, e.g when I go to Admin :: Languages, I get this one:
Error: Language Management is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Could not load type 'Dnn.Modules.Languages.LanguageEnabler'. ---> (etc.)
Or Host :: Dashboard:
Error: Dashboard is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Could not load type 'Dnn.Modules.Dashboard.Dashboard'. ---> System.Web.HttpParseException: Could not load type 'Dnn.Modules.Dashboard.Dashboard'. ---> (etc.)
When I close the browser and re-open it, I get an empty page (which is correct, as I installed the empty template) with two red error boxes saying (both): "An error has occured. An error has occured." Whatever I do (there is not too much, but e.g. clicking the login link, I get the same errors.
I have another DNN 7.4.2 portal on this machine which runs fine. I checked the permissions, I deleted the cache, I deleted the browser cache and cookies, I stopped the app pool and deleted the "ASP.Net Temporary Files" folder (under C:\Windows\Microsoft.NET\Framework\v4.0.30319 and C:\Windows\Microsoft.NET\Framework64\v4.0.30319) and restarted the app pool - nothing did help. I compared all the settings in IIS manager and web.config - all the same so far, except some stuff on the other portal that is needed for AD Login, another menu or stuff like this. And: in the [system.webServer] section I found the sections [modules] and [handlers] - on the other installation these were called [httpModules] and [httpHandlers], but when I changed these, I got an internal server error.
I started all over again. Same thing. I started again with DNN 7.4.1 - same thing.
Anyone out there who has an idea what could be wrong?
Happy DNNing!
Michael

Laravel: Gracefully Fallback if Session Database is Not Avaiable

Is there a middware, package, or general approach for having Laravel gracefully fallback to a session-less state if the session storage engine isn't available?
That is, let's say you have you a system using the database session engine. If that database goes down, Laravel's going to throw an exception whenever it can't connect to the database. I'd like a way to, instead, have Laravel not throw an exception, and just continue on without a working session engine.
(I realize this will mean careful coding on the application level to never assume sessions are available, but a pre thank you for all the warnings)
Use Case to Correct For:
Session storage system goes down temporarily (maintenance window, unexpected outage, etc).
Logged in user hits a page, sees Laravel error page because session engine can't connect
User is sad
I'd rather the user see some sort of normal web-page instead of a generic error message, even if that means we can't include stateful session data on the page.
That depends, Laravel does not persistently require a session engine to work, only on pages that actually use it. So that means that a fallback would basically not help - in fact an exception is the best thing Laravel can actually do to help you here.
Why? Because an exception can be cought and, if that is what you want to do (even though it makes little to no sense), be ignored.
Maybe I'm understanding you wrong, what exactly do you want to fall back to?
For me it's really hard to imagine how could it work and what you need it for. For example when you need user to be logged to access some page what should happen if session db or whole db is down? For me the only solution is show the user info that something gone wrong because it will be hard to pretend that website is working if it's not. So application throw exception, you catch it and display error page for user (and send site admin e-mail or sms)
If you would try to pretend you probably make your users angry because they would try to log in and they wouldn't be logged in without any info, so they would try 2nd time, 3rd time and finally they would think that your site is broken and would never come back again. In my opinion it's better to tell them something is wrong and "hey, come back here in about 2 hours"

EJB 3.1 lookup returns null remote object

I am using EJB3 deployed on WAS 8.
I am accessing this EJB from my WEB server using Context.lookup.
This look up works fine and the entire application works fine for the first time after WAS is restarted.
However when I run the application for the second time, the look up does happen, but a NULL value is returned.
I dont get any exception or error or any logs on WAS.
Again if I restart the WAS, the application works well.
Can anyone please guide what the issue can be?
Remote references are connection-less proxies. If the application is redeployed/undeployed or there is network failure, the proxies are invalidated.
You can use ServiceLocator pattern for caching the references of the remote objects. You can remove & again re-create them with JNDI lookup when they become invalid.

Unexpected Error in content staging DNN6 Enterprise

guys! I've got a very strange error when trying to connect two portals.
When I press whatever 'connect portals' or 'test connection' buttons a red error appears sayin' "An unexpected Error has occurred while validating your request". Yikes!
So, I ensured the similar workflow is running on both sites. Next, I've done some debugging and discovered the malfunctioning method in
DotNetNuke.Enterprise.ContentStaging.StagingClientController.cs
public bool PingServer(string address, int portalId, Guid token)
{
/*====somecode====*/
client.PairService(request);
/*====somecode====*/
return true;
}
So, the pair service. After some more advanced debugging I've found a root of evil:
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_PortalSettings_Portals". The conflict occurred in database "MyDNNDatabase", table "dbo.Portals", column 'PortalID'.
The statement has been terminated. Gosh!
So, I've removed the specified constraint and saw a strange thing in my database. DNN tried to add another LocalServerToken with testing site ID though a targetServerAddress and TargetServerToken with Production site ID were expected to be added.
So, I've deleted a site and created a new one using the template. No luck as I expected.
THe last thing I did was manual adding a targetServerAddress & TargetServerToken in my database. The sites seemed to be connected but when I couldn't authenticate as Host and publishing content caused the same unexpected Error.
Anyone know the damn module so deep?
As mentioned on the DNN community exchange, please open a support ticket to get this addressed. That is what paid support is for with PE and EE ;)

Resources