U4-4509 - Umbraco 7.0.4 Backend login not working Windows 2008 R2 (OS Spanish Culture problems)

Created by Ivan 23 Mar 2014, 20:38:19 Updated by Shannon Deminick 26 Jun 2017, 07:13:12

Is duplicated by: U4-4540

Is duplicated by: U4-5495

On Windows 2008 R2 Server English Culture, Umbraco 7.0.4 works correctly and calling /umbraco/backoffice/UmbracoApi/Authentication/GetCurrentUser returns following data:

)]}', {"email":"my@email.com","locale":"en-GB","emailHash":"5ab892085cdb448c088633adfa9fd1fe","userType":"admin","remainingAuthSeconds":1101.1718203,"allowedSections":["content","developer","media","member","settings","users"],"id":0,"name":"admin"}

In this case, the view returns "remainingAuthSeconds":1101.1718203, so Umbraco 7.0.4 Backend works as expected but in Windows 2008 R2 production server (OS Spanish culture) it returns "SecondsUntilTimeout":1167.5208, instead of "remainningAuthSeconds" and "Culture" instead of "locale".

)]}', {"Email":"jwebgestion@gmail.com","Culture":"en-GB","EmailHash":"5ab892085cdb448c088633adfa9fd1fe","UserType":"admin","SecondsUntilTimeout":1185.8976,"AllowedSections":["content","developer","media","member","settings","users"],"UserId":0,"Name":"admin"}

So after a successful login it throws the following error:

The user object is invalid, the remainingAuthSeconds is required. angular.min.js(63)

And Umbraco 7.0.4 Dashboard is totally broken.

14 Attachments

Download UmbracoTraceLog.zip

Comments

Sebastiaan Janssen 24 Mar 2014, 10:20:56

Is .NET 4.5 installed on this server? Did you upgrade this site from a previous version? How is the dashboard "broken"? Screenshot would help. Any other javascript errors?

Have you tried clearing your cookies to make sure there's no conflicts?


Ivan 24 Mar 2014, 11:09:23

Hi Sebastiaan, .NET 4.5 is installed on the server and is a new clean Umbraco 7.0.4 installation.

Clearing cookies and browser caché does not solve the problem (Chrome, Firefox, Opera, IE 10/IE11, Safari). See attached screenshots for further information and javascript errors.


Sebastiaan Janssen 24 Mar 2014, 14:08:34

@ivan Hmmm, interesting, it might have something to do with the Spanish locale then, could you attach your log files from App_Data\Logs to this issue. They might contain private information so make sure to set the "Visible to" field to "HQ" instead of "All users" so that only Umbraco HQ gets to see them.


Sebastiaan Janssen 24 Mar 2014, 15:20:44

Thanks Ivan! Looking at your logs reminded me of something: is your database user also in the spanish locale? Umbraco needs the database user to be set to English. Could you try and see if that makes a difference please?


Ivan 24 Mar 2014, 16:06:31

Hi Sebastiaan! I have changed database collation to "Latin1_General_CI_AS" and set database user to English. Still same errors.


Frank van de Laar 01 Apr 2014, 17:54:26

Hi! Any luck fixing this? I'm running into the same problem. It's on a shared hosting environment, so I can't really check all server settings, but it's a Windows 2012 machine using .NET framework 4.0.30319.18449 (corresponds to the februari update to 4.5.1) and using SQL CE. The hosting provider is Dutch, so it could be culture related


Ivan 01 Apr 2014, 18:09:42

Hi Frank! No luck. I still got the same problem so, in the meantime, I'll just keep using Umbraco 6.


Ulrich Ebsen 03 Apr 2014, 18:41:18

Hi

I'm experiencing the same issues. I have full control over the server, and have updated everything on the server (windows 2012). I get the same error on login, and a fresh install just hangs on the first screen... The server is running loads of umbraco 6.x and 4.x sites without issues. I don't think it's a database issue as a fresh install also fails... Server language is set to english and region Denmark.

Attached is Chrome console view of an install (the very first screen) (only visible for HQ)

update

I think I found the issue! If Helicon Ape (http://www.helicontech.com/ape/) is installed at server/IIS, something makes umbraco 7 break... I tried installing / uninstalling three times just make sure...!

Ulrich Ebsen


Frank van de Laar 04 Apr 2014, 14:20:04

You're totally right Ulrich, Helicon Ape is causing the problem. I just checked both on the shared hosting I was using and in a separate VM. Unfortunately, disabling Helicon Ape through either the Helicon Ape manager or by remove the module in web.config doesn't solve it, only uninstallation...


Frank van de Laar 08 Apr 2014, 18:45:15

It looks like this has been solved in the 7.1.1 release. I just upgraded my site from 7.0.4 to 7.1.1 and I can log into the backend without any errors. Nice!


Flavio Spezi 16 Sep 2014, 16:30:33

Hi

I deploy website to shared web hosting. The server uses Helicon Ape, but I disabled it in my website. The website is developed with Umbraco 7.1.6.


Matthias Bier 30 Oct 2014, 08:09:29

I have the same problem with Umbraco 7.1.6. and helicon ape installed but disabled on the shared webserver.

The hoster tried to disable it for my site only but this did not help at all. After they completely disabled it on the server I can at least see the login page. But when trying to login I get this error...

Afterwards I can see a blank backend page by hitting refresh in the browser...


Shannon Deminick 30 Oct 2014, 11:35:07

(you didn't post the error...)


Matthias Bier 30 Oct 2014, 11:41:32

Sorry!

I can see this error in the console since the Ape module is disabled: "The user object is invalid, the remainingAuthSeconds is required."

As it was still enabled I got an encoding error: ERR_CONTENT_DECODING_FAILED from Chrome

Thank you!


Matthias Bier 31 Oct 2014, 09:23:09

I copied the umbraco files to my local pc and run Umbraco from there - everything works when run locally (database is still remote)!

I noticed that the response from "umbraco/backoffice/UmbracoApi/Authentication/PostLogin" differs when run locally:

on shared webhost: AllowedSections: ["content", "contour", "developer", "media", "member", "settings", "users"] Culture: "en-GB" Email: .. EmailHash: .. Name: "admin" SecondsUntilTimeout: 1200 UserId: 0 UserType: "admin"

locally: allowedSections: ["content", "contour", "developer", "media", "member", "settings", "users"] email: ... emailHash: ... id: 0 locale: "en-GB" name: "admin" remainingAuthSeconds: 1200 userType: "admin"

So on the shared host there's no "remainingAuthSeconds" item but a "SecondsUntilTimeout" item.

How can that be?


Sebastiaan Janssen 31 Oct 2014, 09:58:31

Hmm, the most interesting thing I see here is that the casing is different, everything starts with uppercase on your host. No idea how that happens but that could well be the cause of your login problem. I don't have time to investigate today but you should google for that, in the background we're using ASP.NET WebAPI and the json result that we send back should look like the one you see locally.

The remainingAuthSeconds vs SecondsUntilTimeout is because you're either properly logged in or not I think so I'm not worried about that one.


Matthias Bier 31 Oct 2014, 11:38:56

Thanks for that hint! This makes it quite clear that it's not an umbraco issue.

I did some googling but I saw nothing that explained the change in casing...


Sander Boekenoogen 01 Nov 2014, 21:36:48

The source of the problem can be found found in a particular assembly installed in the GAC during installation of Helicon Ape: Newtonsoft.Json.dll, version 6.0.0.0. Umbraco 7 also uses Newtonsoft.Json.dll, version 6.0.0.0, deployed in the local bin folder. Because both assemblies share the same version number, the one in the GAC is used by default. Most unfortunately the Newtonsoft.Json.dll used by Helicon Ape is not equipped with certain Convertors: EntityKeyMemberConverter and ExpandoObjectConverter. Umbraco however needs the EntityKeyMemberConverter to read DataMember Name attributes (e.g. [DataMember(Name="remainingAuthSeconds")] ) from certain objects like UserDetail. This Name attribute is used as a 'friendly' name that can be interpreted by client-side code. If the DataMember can't be read because the convertor is missing, the property name (e.g. SecondsUntilTimeout) is used instead. As a consequence client-side rendering gets messed up completely.

In order to solve this problem we need to deploy either a higher version of Newtonsoft.Json.dll in our bin folder or we need to install the original Newtonsoft.Json.dll version 6.0.0.0 in the GAC. Obviously, a version 7.0.0.0 is not yet available. Uninstalling Helicon Ape might also be an option. It has however nothing to do with Spanish culture.


Matthias Bier 04 Nov 2014, 10:59:48

Great work tracking this down!

Helicon Ape should just install an unmodified version of Newtonsoft.Json.dll.

We should be able to just overwrite the dll by installing an original version into the GAC, right? This would be the easiest work-around (beside uninstalling Helicon Ape).

Question is of course if this break helicon ape...


Flavio Spezi 04 Nov 2014, 11:06:02

Maybe this page show how to solve the issue: http://www.aip.im/2013/04/how-to-force-iis-asp-net-to-use-assembly-from-the-bin-folder-instead-of-gac/

Now I will try it.


Sander Boekenoogen 04 Nov 2014, 11:10:45

That's a great find, Flavio! I really hope that's going to work. Keep us updated.


Matthias Bier 04 Nov 2014, 11:21:16

I inserted this into web.config

But it did not solve the problem. If I remove the line with

<bindingRedirect...

I get:

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.


Sander Boekenoogen 04 Nov 2014, 11:54:18

Umbraco 7 is originally build with a reference to version 4.5. Try this instead:


Matthias Bier 04 Nov 2014, 12:14:21

I guess I will need the version 4.5.0.0 of the dll then...

Will try this.


Sander Boekenoogen 04 Nov 2014, 12:22:09

Then again, maybe in this case the version refers to the file version which should be 6.0.2.16931 for Umbraco 7.1.4 Just take a look at the file properties of Newtonsoft.Json.dll.


Sebastiaan Janssen 04 Nov 2014, 12:37:40

I am not saying this will work.. but:

Umbraco 7 is built against json.net v6. You should already have the following in the web.config:

So don't add the codebase. You could try to update it to the minor version in your bin folder, so in 7.1.4 it would be


Sander Boekenoogen 04 Nov 2014, 12:44:32

That's not going to work either. Here newVersion refers to the assembly Version which is set at 6.0.0.0 . See also http://james.newtonking.com/archive/2012/04/04/json-net-strong-naming-and-assembly-version-numbers


Sebastiaan Janssen 04 Nov 2014, 12:52:56

Yes, that was HORRIBLE. He's since changed his mind luckily and at least 6.0.2 has assembly version 6.0.0.


Matthias Bier 04 Nov 2014, 13:09:21

None of these seem to work :-( at least for me.

Does somebody has helicon ape installed locally and can test if replacing the dll in GAC works? I guess my hosting provider will not try this for me.


Sebastiaan Janssen 04 Nov 2014, 13:21:08

@matthiasbier Did you figure out what exact version is in your bin folder? Maybe try to add the <codebase> node as well, including the correct version?


Flavio Spezi 04 Nov 2014, 13:29:48

In my "bin" the "File version" is "6.0.4.17603", and the "Assembly version is "6.0.0.0".

I was try many combinations. I look that the only configuration that will be compiled is this:

...and this:

Both configs give me a compiled web site, but the Umbraco Login does not works properly yet. I have the same behavior of start.


Matthias Bier 04 Nov 2014, 13:31:51

Yes, I tried with the AssemblyFileVersion 6.0.4.17603 (Umbraco 7.1.5) but this did not help.

I get two errors on the error page:

[FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]

[FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.4.17603, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]

Seems as if he just ignores the AssemblyFileVersion.


Sebastiaan Janssen 04 Nov 2014, 13:39:52

Yeah, don't use the patch version though, just make that 0

Seems very weird that it's looking for 4.5.0.0 though, you're specifically saying: redirect all calls to all versions to 6.0.4. So if it doesn't help with 0 on the end you might have a file in your bin folder that is specifically built against 4.5.0.

It think you can do the following: if you can download json.net with assemblyversion 4.5, throw it in bin\legacy then update your assemblybindings to:

Again, not sure if this will work but I recall some okay experiences with this for HtmlAgilityPack. json.net reference has always been quite more complicated though.


Matthias Bier 04 Nov 2014, 14:12:38

Did so, but he still complains about 4.5.0.0 as before. The second error line is gone now.

I used Json.NET 4.5 Release 11 which has a AssemblyVersion of 4.5.0.0


Sebastiaan Janssen 04 Nov 2014, 14:19:50

Can you compare the list of dlls you have in your bin folder to the list of dlls we ship with Umbraco? Curious to see if there's any plugins that rely on json.net 4.5. I can't see why this redirect wouldn't work though.. hmmm


Sebastiaan Janssen 04 Nov 2014, 14:23:18

Also you may have a NuGet package overwriting the version in the bin folder maybe? Kinda like this question here: http://stackoverflow.com/questions/11430396/referencing-different-versions-of-json-net-dll


Flavio Spezi 04 Nov 2014, 14:32:19

I found that the "umbraco.dll" (version 1.0.5350.25719) uses "Newtonsoft.Json" version 4.5.0.0 and 6.0.0.0.


Matthias Bier 04 Nov 2014, 14:34:54

kind of weird...


Matthias Bier 04 Nov 2014, 14:38:06

Since I'm working via FTP there should be no nuget package involved, right?


Sebastiaan Janssen 04 Nov 2014, 15:19:17

@fspezi How do you see that? We only ever reference v6.0.0 and SpecificVersion is set to false.


Matthias Bier 04 Nov 2014, 15:23:34

Here's a screenshot of JustDecompile.


Flavio Spezi 04 Nov 2014, 15:32:40

I look this:


Sander Boekenoogen 05 Nov 2014, 07:45:32

Guys, we are running out of options here. It's time to spank that hell-of-an Ape and urge them to solve this blocking issue in their software: http://www.helicontech.com/community/Incomplete_version_of_NewtonsoftJson_installed-8-3279.html?sid=49b172debdcfb9afdcd8739197719be3


Flavio Spezi 05 Nov 2014, 08:23:32

Beautiful!! Great job!


Matthias Bier 05 Nov 2014, 08:45:11

Well, they don't seem to care very much about it. When I have time I will try to install it on my PC and then try to replace the GAC ddl with the original one...


Sander Boekenoogen 07 Nov 2014, 13:35:00

Helicon Ape did pick up the message alright. Hopefully next week we can expect a solution:

The following comment was added to ticket [ape-21232] Release 3.1.0.136: Newtonsoft.Json.dll version changed to 6.0.3 -> blocking issue:


Hello,

Sorry for not getting back to you earlier. Our developers are currently working on this issue and we expect to get the results next week. I'll inform you as soon as we arriva at a solution.

Sorry for inconvenience.


Flavio Spezi 07 Nov 2014, 13:46:19

Thanks


Ehsan 14 Nov 2014, 16:40:57

@sandboek @fspezi

I'm having the same issue, Are you guys 100% if this assembly update will fix it? because I never had Helicon Ape installed and I have checked my gac and do not have newton.soft in there. I'm still puzzled :s


Sander Boekenoogen 14 Nov 2014, 23:32:28

@Ehsan

I'm affraid this only solves the problem involving Helicon Ape. Helicon Ape's GAC based version of Newtonsoft.Json is lacking the EntityKeyMemberConverter. However, Umbraco 7.0.4 should have the EntityKeyMemberConverter at its disposal, provided Helicon Ape is not interfering. Obviously with English culture its working so there must be something with Spanish culture that causes the EntityKeyMemberConverter to fail or at least be bypassed. This might indicate a bug in the EntityKeyMemberConverter itself. You'd have to take a closer look at the sources of Newtonsoft.Json and perhaps run some tests to figure out exactly what's going wrong.


Andrew Tregonning 15 Nov 2014, 01:57:57

I encountered this Helicon Ape conflict earlier in the year ([thread|http://our.umbraco.org/forum/umbraco-7/using-umbraco-7/48023-Unable-to-login-to-back-office-after-deploying-Umbraco-7-to-server]), and the only solution I found was to move my Umbraco 7 sites at a hosting provider that doesn't offer Helicon Ape.

The suggested dependentAssembly\codebase override for Newtonsoft.Json won't work, as according to [MSDN|http://msdn.microsoft.com/en-us/library/yx7xezcf(v=vs.110).aspx], the runtime checks the GAC before probing for the assembly based on the configuration file.


Ehsan 15 Nov 2014, 06:35:49

Ok I have done some screen shots now and as you can see I am seeing the same symptoms.

My Umbraco 7.1.6 instance was working fine initially and I was just playing around with with the templates(views), developing in MVC. I am not sure why all of a sudden It doesn't log me in anymore. Keep in mind I did not change any security permissions and everything was working fine. I can now just view the public website I built but not the backoffice. also I do not have Helicon installed.

my defualt culture is set to English. in the webconfig I set Globalization to and still no luck.

I have been fighting this issue for 3 days straight now, searching the net for a solution but nothing yet. I think I might just have to install a new instance. I'm worried this will happen again :s

here is the /umbraco/backoffice/UmbracoApi/Authentication/PostLogin call json response right after I click login allowedSections: [content, developer, media, member, settings, users] email: "p4persian@hotmail.com" emailHash: "11996fb05c18a102f05ab828f7eb9e82" id: 0 locale: "en-GB" name: "Ehsan" remainingAuthSeconds: -0.0560077 userType: "admin"

any thoughts?

Thanks for reading.


Sander Boekenoogen 15 Nov 2014, 08:03:58

@Ehsan: This appears to be a different issue. The JSON string returned shows the correct format but your remainingAuthseconds has a negative value, thus forcing you to login again.

@Andrew: you are right. We can't solve the issue in our web.config with an assembly redirect. That's why we're (still) waiting for Helicon Ape to fix it on their side.


Matthias Bier 18 Nov 2014, 08:44:32

Did someone try the new version of helicon ape? http://www.helicontech.com/community/Incomplete_version_of_NewtonsoftJson_installed-8-3279.html

I will urge my Service Provider to do so but I'm not sure how soon they will react...


Sander Boekenoogen 18 Nov 2014, 08:50:39

@Matthias: I tested it yesterday on my local development environment and it works (on my machine)! My hosting provider has already planned an installation for the new Helicon Ape release. Hopefully within a few days I can confirm it also works on a shared hosting machine.


Flavio Spezi 18 Nov 2014, 09:23:34

Sorry to all, I know that it is not right but... can I know your providers? I'm using a provider that I are not fully satisfied.


Ivan 18 Nov 2014, 10:51:47

Running Helicon Ape latest version (3.1.0.145) on my production server (Windows 2008 R2 Spanish shared hosting machine). I have installed Umbraco 7.1.8 for testing and everything is working properly.


Matthias Bier 18 Nov 2014, 16:45:31

My Service Provider just told me that they uninstalled helicon ape 1 week ago... But they did not tell me.

I immediately tried to login and it works again.


Sander Boekenoogen 18 Nov 2014, 21:45:44

My hosting provider must have finished installing the new release of Helicon Ape already because my back-end login is up & running again.

@Flavio: I'm using a Dutch provider from the list of recommended hosting providers by Umbraco: http://our.umbraco.org/wiki/install-and-setup/trying-out-umbraco-before-you-install/recommended-hosting-providers.


Shannon Deminick 18 Nov 2014, 22:14:12

Great! So I'm wondering, can we close this issue ?


Sander Boekenoogen 18 Nov 2014, 22:21:14

I think this issue can be closed now...


Shannon Deminick 18 Nov 2014, 22:22:59

Awesome, good detective work everyone! :)

I'll close this issue now.


Sebastian Dammark 28 Apr 2015, 09:54:50

@p4persian Did you find a solution to your problem ?

I have a customer with the exact same problem as you. He cannot log in, Helicon Ape is not installed and Newtonsoft.Json is not in GAC.


David Conlisk 06 Aug 2015, 10:38:08

Hi all,

I don't think that this error has been completely fixed. I am getting the exact same issue, and my setup:

  • Fresh Umbraco v7.2.8 on my development laptop running Windows 7 Professional (nuget install)
  • I've never used the Spanish culture or locale on my machine
  • Using default SQL CE database
  • Site running under IIS 7.5
  • I've never installed this Helicon Ape software on this machine (or anywhere else)
  • I've tried the suggested changes to the web.config mentioned above, and no joy
  • The only package that I've installed is Archetype
  • Newtonsoft.Json.dll is not installed in the GAC on my machine

I am getting the same error in all browsers, deleting cookies/cache/etc no joy. The Umbraco log tells me that the user is being logged in correctly. The site worked fine for the first couple of days after install when I was working on it daily, but after not logging in at all yesterday, today I can't get past this error.

Thanks,

David


David Conlisk 06 Aug 2015, 10:46:21

Hi all,

On further investigation, it seems that in a moment of exceptional clarity I set the umbracoTimeoutInMinutes app setting to zero. Oops. Resetting it to a positive integer fixes the problem. However, it's still a pretty opaque error that the user gets in this case.

Thanks,

David


Shannon Deminick 26 Jun 2017, 07:13:12

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/


Priority: Normal

Type: Bug

State: Closed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:

Sprint:

Story Points:

Cycle: