Umbraco suddenly login failed for user - sql

I'm currently using the CMS Umbraco for my website to handle my blog. While suddenly the login won't work for any user.
UmbracoTracelog
Event Id: 0, state: Login attempt failed for username test from IP
address 127.0.0.1
I've checked my MSSQL where all instances are running and connecting
correctly to my project.
I've tried the UmbracoAdminReset.dll but it doesn't make any
difference.
I've tried to manually change the password in the MSSQL Umbraco users
table with the same login attempt failed error
I've tried to login on different user and still gets the same error
I've built i have restarted the computer but the error still applies, this worked earlier today, All i have done is just working with Disqus comment API on their website.
I've noticed in my Web.config that i have errors in (I manually replaced the PublicKeyToken here with *******)
<sessionState mode="InProc" customProvider="DefaultSessionProvider">
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=***************" connectionStringName="DefaultConnection" />
</providers>
</sessionState>
Invalid module qualification: Failed to resolve assembly System.Web.Providers
Cannot Resolve symbol DefaultSessionStateProivder
The website runs fine, I get to the login page, I just cannot login because I get Login attempt failed error.
EDIT:
In my Errorlist i can see 28 messages that says:
Could not find schema information for element __
UmbracoConfiguration
security
settings
and 25 more with the same.

It seems like you are missing the DLL for 'System.Web.Providers' OR you are using a different version.
If you publish from Visual Studio, ensure you have set 'CopyLocal' to TRUE if your project references this DLL.
You could also just try to FTP the missing file up to your hosting account.
Let me know how it goes.
Regards
Craig

Related

Login issue after publishing .Net Core 3.1 web app to IIS

I created a .Net Core 3.1 MVC application that is using induvial user accounts as authentication. I deployed the site to IIS, which works. However when I tried to log in with an account I know that works, the login does not succeed, and I am directed back the default route of the application. No error messages or log entries that I can find. The application pool is set up for non managed code, and is running under an account that has dbo rights to the database. Any thoughts as to what the issue might be?
http://localhost:44360/ running on server on Visual Studio 2022
http://localhost:2710/ running on server on IIS
http:// domain . com not working
It is difficult for everyone to help you without error messages. Have you tried swapping to a development environment to see the details of the error?
Locate the Web.config file and adjust it to set the ASPNETCORE_ENVIRONMENT environment variable as follows:
<aspNetCore processPath="dotnet" arguments=".\ProjectName.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" >
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
</aspNetCore>
This method worked for me to find the error, you can try it.
This field already exists in the web.config file.
It gives a warning when the user is wrong, but when we enter the correct user information, it does not create cookies or sessions and does not fall into any errors.

outofmemory Exception for Microsoft.Web.RedisSessionStateProvider if using obfuscated libraries

I want to use the Microsoft.Web.RedisSessionStateProvider as a session cache provider for an asp.net application. I have to use some obfuscated libriares in my application. Once I add them, I get an out-of-Memory exception. The Cache works if I remove the references to those libraries. The exception occurs immediately after global.asax application_start. Maybe directly before or on session_start.
<sessionState mode="Custom" customProvider="LocationNewsCache"> <providers>
<add name="LocationNewsCache" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="link to AWS ElastiCache"
port="6379" accessKey="" ssl="false" throwOnError="true"/> </providers> </sessionState>
the error marks the "add Name" line as red and states it as System.OutOfMemoryException
Do you have any implementation in your global.asa? Post the code here! Do you connection with Redis Server is ok? Change provider version Microsoft.Web.Redis.RedisSessionStateProvider.

Unable to find the requested .Net Framework Data Provider.

I've seen several posts about this, but none of the answers seem to work.
I'm trying to set up simplemembership and I keep getting this error when WebSecurity.InitializeDatabaseConnection(...) is called
Here is the ConnectionsStrings entry:
<add name="JBarterMain" connectionString="Data Source=winsrv01;Initial Catalog=ProvausioJBarter;Persist Security Info=True;User ID=xxx;Password=xxx" providerName="System.Data.SqlClient"/>
I tried adding the following to my machine config in the .net 4.0 x64 folder:
<add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
I'm getting absolutely nowhere. This seems incredibly odd to me that this wouldn't work out of the box. I had another project a few months ago (broken currently so I can't verify that it still works) that was working just fine and I didn't have to do any additional configuration.
Any ideas?
I wrote a tutorial on how to set up simple membership Here. Also I prefer to ditch the filters and initialize it directly on application start

Trying to find out why my WCF service is not working

Over a year ago I had been working on a WCF service, which I wrote using VS 2008. It runs under a Windows service, which I also wrote. It’s been running there ever since. And unfortunately, other projects/priorities have come up, preventing me from continuing with that project, until now.
Now I’m trying to get back to it. However, this go around I’m trying to find out if I can use VS 2010 and .NET 4, instead of .NET 3.5. I’ve brought up the command prompt, to run SvcUtil, to get the wsdl information, which I’ll put into the config file for the new WPF app I’m trying to get started writing. Only thing is, I keep getting an error, saying that I can’t reach the server, etc.
So, I copied the .exe.config file from the server to my machine, where I could edit it with SvcConfigEditor. I’ve made those changes, put it back onto the server, and got an error while trying to run SvcUtil, but worse than that I didn’t see the .svclog files I expected to see. So I got into the server’s Services app. I found the Windows service I wrote a year ago; saw that it was running, and stopped and started it again.
Now I’ve got a different problem. My Windows service starts, but then stops immediately. I get this message saying that the service had started and then stopped, and saying that sometimes that happens with different sorts of services, like Performance Logs and Alerts services. I’ve checked the event log on the server, and then only thing there related to this Windows service is that it entered the start state and then entered the stopped state.
Ah, after attempting to start it 4 times, it finally gave me an error in the event log! (Why didn’t it do that in the first place? And who says that trying to do the same thing over and over again, and expecting different results is a sign of insanity, when clearly the first 3 times it didn’t register anything in the event log, but on the 4th try it did.)
Here’s the error:
Event Type: Error
Event Source: Service1
Event Category: None
Event ID: 0
Date: 5/4/2011
Time: 10:14:46 AM
User: N/A
Computer: HELIOS
Description:
Service cannot be started. System.TypeInitializationException:
The type initializer for 'System.ServiceModel.DiagnosticUtility'
threw an exception. --->System.Configuration.ConfigurationErrorsException: Couldn't find type
for class System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089.
at System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType,
String initializeData)
and here’s the new section of code put into the .config file by SvcConfigEditor:
<sharedListeners>
<add initializeData="C:\Program Files\ASIWindowsService\ASIWindowsService_tracelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
<add initializeData="C:\Program Files\ASIWindowsService\ASIWindowsService_messages.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
</sharedListeners>
This question was answered in the comments but there is a gotcha that I've seen in Visual Studio 2010 that could result in a similar situation.
Even if the target framework is set to version 3.x for a WCF project, using the 2010 SvcConfigEditor will automatically insert "System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0..." although it should be inserting "System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0..." This will bite you when deploying the altered web.config to an IIS hosted service where the AppPool is not configured to use the .NET 4.0 framework. The fix is simply edit the web.config back to "Version=2.0.0.0".

HTTP Error 404.3 - Not Found" while browsing wcf service on Windows Server 2008(64bit)

I am developing an application based on .Net Framework 3.5 sp1 and hosted on windows server 2008(64bit).
While browsing wcf service (.svc) locally every things is ok but while browsing with full domain URL, it got an error.
local address is like this: http://localhost/MyService.svc
and domain address is like this: http://MySite.ir/MyService.svc
by the way pages (.aspx) and other files work correctly both on localhost and with domain address.
any Idea would be appreciated
Here is detailed error:
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
Detailed Error Information
Module: StaticFileModule
Notification: ExecuteRequestHandler
Handler: StaticFile
Error Code: 0x80070032
Requested URL: http://MySite.ir:80/MyService.svc
Physical Path: D:\inetpub\vhosts\MySite.ir\httpdocs\MyService.svc
Logon Method: Anonymous
Logon User Anonymous
Please make sure you've activated WCF components from here.
Or alternate and easy way is, go to control panel -> Turn Windows feature on or off -> and make sure you've all the options ticked as mentioned in below screenshot.
You might need to activate each box and accept in case you get errors when activating all features at once
OK, here is the answer:
Go to Handler Mappings | Add Handler Manager --> And then add below information
Request Path: *.svc
Type: System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Name: svc-Integrated
If anyone has this issue on Windows Server 2012, Bill Moon's answer here solved it for me:
"For Windows Server 2012... From the Server Manager, click on Add roles and features, select the appropriate server, then select Features. Under .NET Framework 4.5 Features, you'll see WCF Services, and under that, you'll find HTTP Activation."
I have windows 10 in my laptop and using visual studio 2015 for WCF development. WCF is running fine in visual studio but when hosted in IIS I got the same error.
I checked IIS handler. svc extension was missing. So I tried to add new handler in IIS as suggested by Mori in first answer. I didn't find type "System.ServiceModel.Activation.HttpHandler".
So I opened "Turn windows features On or Off" and installed features as highlighted in screen shot.
This worked for me.
If you're using .Net 4.x, the PublicKeyToken is 31bf3856ad364e35.
However, following this post about installing WCF Services properly in IIS, the handler was set up for me.
I wanted to add this as a comment to the answer but didn't have enough rep for it. I tried running ServiceModelReg and aspnet_regiis.exe with various flags and added HTTP Activation feature but it still didn't work. Even using the Handler mapping UI in IIS didn't work since it could not find System.ServiceModel.Activation.HttpHandler. What finally worked was adding the handler Mori mentions manually to my web.config file.
<system.webServer>
<handlers>
<add name="svc-Integrated" path="*.svc" verb="GET,HEAD,POST,DEBUG" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" modules="ManagedPipelineHandler" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="integratedMode" responseBufferLimit="4194304" />
My project was running .Net 3.5 and IIS 7.5 on Windows 7 and IIS 7.0 on Win Server 2008 R2.
Try unchecking WCF HTTP activations from "Turn Windows featured on or off" window (See here) and re-install by going to
%windir%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\
and execute ServiceModelReg -i