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

The culture specified '' was not found in any configured sources for this service - Linux App Service Plan #13980

Open
wtct opened this issue Mar 16, 2023 · 9 comments

Comments

@wtct
Copy link
Contributor

wtct commented Mar 16, 2023

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

11.2.0

Bug summary

Hi Guys,

Together with @piotrbach, we have noticed an issue which occurs at every Umbraco startup and during operations performed through the ContentService in the custom threads or the Hosted Services.

We can see a lot of warnings in our logs, as below:

"The culture specified '' was not found in any configured sources for this service"

At the beginning, we were solving this warnings by adding a piece of code to each custom theads and Hosted Services, as below:

var cultrue = new CultureInfo("en");

Thread.CurrentThread.CurrentCulture = cultrue;
Thread.CurrentThread.CurrentUICulture = cultrue;

In the meantime, I have invented and implemented a tricky solution which takes into account default language configured in the backoffice.

CultureInfo.DefaultThreadCurrentCulture Property

We are just wondering if the solution available on our blog should be built-in the Umbraco or not.

We haven't found any recommendations related to the Umbraco configuration, but we have found this:

https://www.gulla.net/en/blog/change-locale-culture-for-a-linux-based-azure-webapp/

Maybe this issue could be solved by LANG setting of the Azure App Service. However, what about the default languages set in the backoffice? Should it be taken into account?

image

Specifics

No response

Steps to reproduce

  1. Prepare the Azure Linux App Service.
  2. Deploy the Umbraco.
  3. Run the Umbraco.
  4. Check warnings in the logs.
  5. Create any recurring Hosted Service.
  6. Try to create and save any changes to any node through the ContentService in the Hosted Service.

Expected result / actual result

No response

@wtct wtct added the type/bug label Mar 16, 2023
@github-actions
Copy link

Hi there @wtct!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@Zeegaan
Copy link
Member

Zeegaan commented Mar 20, 2023

Thanks for reporting this 🐛 Wierd one indeed, this works just fine on windows app service plans, so I'm wondering unsure about whether I like the workaround in the core, or have it documented when using Linux app-service plans with Umbraco. I will bring this up to the team and get back to you (this might take a while) 👍

@jrunestone
Copy link
Contributor

jrunestone commented Mar 27, 2023

Hi thanks for posting this we also host Umbraco 11 on Azure linux container apps and this error have been bugging us for some time since it's flooding the error log skewing our log rates.

We also deduced that it was related to processes on other than the main thread; the culture there is empty. Our workaround was also to manually set the thread culture in those processes.

Setting LANG in our web apps did NOT resolve the issue.
Neither did setting DefaultThreadCurrent*Culture.

For context, from what I can see there are just a couple of instances in the codebase that triggers this error, for example: textService.GetAllStoredValues(Thread.CurrentThread.CurrentUICulture); which explicitly assumes a current ui culture set. Maybe the correct way of fixing this is handling an empty culture here? Or should it already be covered by DefaultThreadCurrent*Culture?

@wtct
Copy link
Contributor Author

wtct commented Mar 27, 2023

Hi @jrunestone,

Thanks for letting us know that LANG setting is not working as expected.

However, please ensure that you have set the DefaultThreadCurrentCulture in the IComponent which is registered by composer and running as expected :)

I'm sure, it solved this issue perfectly :)

@vsilvar
Copy link
Contributor

vsilvar commented Nov 20, 2023

Ran into this issue in both a docker container deployment and in a Github action test step.
Setting the LANG=en_US.UTF-8 environment variable solved the issue for both.

I wouldn't expect a linux app service plan to behave any different, so might be worth double checking what value the environment variable was set to.

@jrunestone
Copy link
Contributor

@vsilvar As mentioned, setting the LANG variable does not work. Neither is setting the DefaultThreadCurrentCulture.

@piotrbach
Copy link

Hi @vsilvar thank you for the tip! Yesterday, I experimented with the LANG setting and noticed that the warning disappeared, which was promising. However, after several deployments, it seems the issue has come back and the LANG setting is still there.

@stodolos
Copy link

stodolos commented Feb 7, 2024

Has there been any update on this?

@ajatnow
Copy link

ajatnow commented Mar 12, 2024

I am using Umbraco 13.1.1 and I am still getting this warning message showing up in the startup logs.
I am running the site locally on Windows 11 with the default system culture being en-AU, and the default language being en-AU.

I have tried adding the DefaultCultureComponent as suggested, and also have set the <globalization culture ="auto" uiCulture="auto"/> in the web.config.
Nothing has managed to clear this message :-(
Apparently the LANG setting does not apply to Windows.

Any other suggestions?

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

7 participants