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

Ubuntu + Powershell 7 not finding LocalizedData #332

Closed
astrahan87 opened this issue Mar 16, 2020 · 11 comments · Fixed by #334
Closed

Ubuntu + Powershell 7 not finding LocalizedData #332

astrahan87 opened this issue Mar 16, 2020 · 11 comments · Fixed by #334
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.

Comments

@astrahan87
Copy link

Issue

Details:

  • [ PowerShell 7.0.0 ] Version of PowerShell you're using
  • [ ConsoleHost ] PowerShell host you're using
  • [ Ubuntu 18.04.2 LTS ] Operating system you're running
  • [ 3.5.2.487 ] Version of CosmosDB PowerShell Module you're using

You've fixed the "hard" errors that were occurring with Powershell 7, but we've started seeing some non-terminating error messages related to using Powershell 7:

>> Remove-CosmosDbCollection -Context $cosmosDbContext -Database $DatabaseId -Id $CollectionId
Write-Verbose: /usr/local/share/powershell/Modules/CosmosDB/3.5.2.487/CosmosDB.psm1:5110
Line |
5110 |  …    Write-Verbose -Message $($LocalizedData.NoResourceTokensInContext)
     |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'Message' because it is null.

Just calling "Import-Module -Name CosmosDB" results in:

Import-LocalizedData: /usr/local/share/powershell/Modules/CosmosDB/3.5.2.487/CosmosDB.psm1:24
Line |
  24 | Import-LocalizedData `
     | ~~~~~~~~~~~~~~~~~~~~~~
     | 
Cannot find the PowerShell data file 'CosmosDB.strings.psd1' in directory '/usr/local/share/powershell/Modules/CosmosDB/3.5.2.487', or in any parent culture directories.

Seems like it's not recognizing to look in the /en-US/ subdirectory for some reason.

This was previously working with Powershell Core 6.2 (or at least erroring more quietly).
If this is a misconfiguration on our end for some reason, please let me know.

@topikettunen
Copy link

topikettunen commented Mar 17, 2020

I'm having the same error when running Import-Module -Name CosmosDB. Currently I'm using this module in Azure Pipeline running it with the latest PowerShell task but for some reason it stopped working today. Yesterday everything seemed to be running all fine. Also when running locally there seems to be no problems.

I have tested with the latest 3.5.2.487 version and also the second latest 3.5.1.458 but with no luck.

@PlagueHO
Copy link
Owner

Hi @astrahan87 and @topikettunen , I'm just working on updating the CI process to simplify build and release and will try and identify the cause of this problem at the same time.

@topikettunen - are you using Linux, Windows or MacOS agents?

@topikettunen
Copy link

I use various different agents but the job where I use this module runs Linux (Ubuntu 18.04) agent.

@PlagueHO
Copy link
Owner

Thanks @topikettunen - I'm currently only testing on Ubuntu 16.04. So I'll add some tests on Ubuntu 18.04 to see if I can catch/replicate this.

@PlagueHO
Copy link
Owner

I've added the Xenial tests and will wait for them to complete: https://dscottraynsford.visualstudio.com/GitHub/_build/results?buildId=1429&view=logs&s=859b8d9a-8fd6-5a5c-6f5e-f84f1990894e

It will take a while for the test runs to complete so I'll check on them tomorrow.

@PlagueHO
Copy link
Owner

@topikettunen - have replicated the issue. Looks like it only occurs on PS7 with Xenial and is to do with the case I was using to select the default culture. I've applied a fix and will aim to release tomorrow.

PlagueHO added a commit that referenced this issue Mar 18, 2020
@PlagueHO
Copy link
Owner

Unfortunately the fix I applied didn't work. So I'm going to need to do some further investigation on this. You can see the test failure here:
https://dscottraynsford.visualstudio.com/GitHub/_build/results?buildId=1430&view=logs&j=1b4c76ef-e880-5241-0155-88566c4dcdab&t=c3b097e0-8d2d-5cef-f943-5ce972a892ac&l=81

It appears to be an issue occurring only on Ubuntu 18.04 on PS7 when using the Import-LocalizedData cmdlet. I'll need to set up an Ubuntu 18.04 machine to do some local debugging. I might need to implement a special "temporary" code path for Ubuntu 18.04 to handle this. It does seem like a bug in PS7, so I might also need to raise this with the PS team.

@PlagueHO PlagueHO added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Mar 18, 2020
@PlagueHO
Copy link
Owner

I've found the problem: The $PSUICulture variable is empty on PS7 on Ubuntu 18.04. I've raised as an issue with the PS Team: PowerShell/PowerShell#12149

However, I can work around the issue, so I've put a fix in place and just testing now: https://dev.azure.com/dscottraynsford/GitHub/_build/results?buildId=1432&view=results

@PlagueHO
Copy link
Owner

The tests have passed, so I'll aim to release this later today.

@PlagueHO
Copy link
Owner

This has been released to the PS Gallery in 3.6.1:
https://www.powershellgallery.com/packages/CosmosDB/3.6.1

@astrahan87
Copy link
Author

Looks like it's all working for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants