先日Azure上にサーバーを構築し、そこにSQLサーバーをインストールしようとしたらエラーが発生してちょっと戸惑ってしまったので記録しておきます。

発生したのは以下のエラーです。

Exception type: Microsoft.SqlServer.Configuration.SetupExtension.InvalidLicenseFilePathException

Message:

The SQL Server license agreement cannot be located for the selected edition, EVAL. This could be a result of corrupted media or the edition being unsupported by the media.

HResult : 0x858c001b

FacilityCode : 1420 (58c)

ErrorCode : 27 (001b)

Data:

SQL.Setup.FailureCategory = InputSettingValidationFailure

editionValue = EVAL

WatsonData = Microsoft.SqlServer.Configuration.SetupExtension.InvalidLicenseFilePathException@27

DisableWatson = true

Stack:

at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.LogAllValidationErrorsAndThrowFirstOne(ValidationState vs)

at Microsoft.SqlServer.Configuration.BootstrapExtension.ValidateChainerSettingAction.ExecuteAction(String actionId)

at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)

at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(TextWriter statusStream, ISequencedAction actionToRun, ServiceContainer context)

The following error occurred:

The SQL Server license agreement cannot be located for the selected edition, EVAL. This could be a result of corrupted media or the edition being unsupported by the media.

Error result: -2054422501

Result facility code: 1420

Result error code: 27

Please review the summary.txt log for further details メディアが壊れているのかと思ってダウンロードしなしたりなどしても現象変わらず。色々試して結局言語の設定が原因であることがわかりました。

Azure上に用意されているOSイメージは英語版なので、日本語に切り替えてからSQLをインストールをしようとしていたのですが、システムとしての言語設定とユーザー単位の言語設定があり、その両方をきちんと日本語にしておかなくてはいけないのでした。これはすでに実施していたつもりだったのですが、その設定後にドメイン参加を実施し、新規にドメイン上のユーザーでログイン後のインストールとなっており、そのユーザーではきちんと日本語に設定変更していなかった・・・というわけでした。全自動でスクリプトで流していたので気がつくのが遅くなりました。

PowerShellであれば以下の状態でインストールに成功するようです。

PS C:\Users\Administrator.AO> Get-WinSystemLocale LCID             Name             DisplayName —-             —-             ———– 1041             ja-JP            日本語 (日本)

PS C:\Users\Administrator.AO>  (Get-WinUserLanguageList)[0] LanguageTag     : ja Autonym         : 日本語 EnglishName     : Japanese LocalizedName   : 日本語 ScriptName      : 日本語 InputMethodTips : {0411:{03B5835F-F03C-411B-9CE2-AA23E1171E36}{A76C93D9-5523-4E90-AAFA-4DB112F9AC76}} Spellchecking   : True Handwriting     : True 一方別のケースでは本当にメディアが壊れていたことが原因でSQLのインストールに失敗するケースもありました。色々落とし穴があるものですね。

photo credit: therefromhere via photopin cc