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

xSQLServer resources can't compile in Azure Automation #310

Closed
johlju opened this Issue Aug 17, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@johlju
Contributor

johlju commented Aug 17, 2017

I have a serious problem for Azure users using the xSQLServer module. Reported in issue PowerShell/SqlServerDsc#716 and in issue PowerShell/SqlServerDsc#705.

I have narrowed it down to that resources can't compile because of too long file paths. This seem to have started in version 8.0.0.0.

@kwirkykat Do you know, or do you know someone that know, what the hard limits are for the paths?
Can't find anything in Azure subscription and service limits, quotas, and constraints

I want to create at common tests for this, so would be good that the hard limit is known, so if it changes we can change the test. But I will start with he knowledge I have so far (se below.)

To solve issue PowerShell/SqlServerDsc#716 the relative path can't be longer than 120 characters, i.e 'Examples\Resources\xSQLServerAvailabilityGroupListener\5-AddAvailabilityGroupListenerUsingDHCWithDefaultServerSubnet.ps1' works. If I add back the 'P' in 'DHCP' so the file gets 121 characters long, the compilation fails.

Test configuration used:

Configuration SimpleSqlLogin
{
    Import-DSCResource -Name xSQLServerLogin

    Node localhost
    {
        xSQLServerLogin Add_WindowsUser

        {
            Ensure               = 'Present'
            Name                 = 'CONTOSO\WindowsUser'
            LoginType            = 'WindowsUser'
            SQLServer            = 'SQLServer'
            SQLInstanceName      = 'DSC'
        }
    }
}

Exception in AzureAutomation

Exception calling "NewScriptBlock" with "1" argument(s): "At line:4 char:5 
+ Import-DSCResource -Name xSQLServerLogin 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unable to load resource 'xSQLServerLogin': Resource not found. At line:8 char:9 + xSQLServerLogin Add_WindowsUser
+ ~~~~~~~~~~~~~~~ Undefined DSC resource 'xSQLServerLogin'. Use Import-DSCResource to import the resource." (At line:4 char:5 + Import-DSCResource -Name xSQLServerLogin
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unable to load resource 'xSQLServerLogin': Resource not found. At line:8 char:9 + xSQLServerLogin Add_WindowsUser
+ ~~~~~~~~~~~~~~~ Undefined DSC resource 'xSQLServerLogin'. Use Import-DSCResource to import the resource.)
@johlju

This comment has been minimized.

Show comment
Hide comment
@johlju

johlju Aug 18, 2017

Contributor

Heard from @kwirkykat that Azure Automation Team is working on the long path issue. Let's await that before making any tests or changing the xSQLServer module. There probably is gonna be a hard limit, but hopefully it will be much higher.

Contributor

johlju commented Aug 18, 2017

Heard from @kwirkykat that Azure Automation Team is working on the long path issue. Let's await that before making any tests or changing the xSQLServer module. There probably is gonna be a hard limit, but hopefully it will be much higher.

@johlju

This comment has been minimized.

Show comment
Hide comment
@johlju

johlju Sep 19, 2017

Contributor

@kwirkykat @zjalexander Is there anything new around this, could you reach out to your contact again and ask for an update? Or should we just wait?

I just tested and the same problem is still there. I'm looking for if this will be possible for them to resolve, and if so, what the hard limit will be.

Last status update when @kwirkykat reached out:

We have a bug tracking the long path issue. It’s currently assigned to Sourabh’s team. (Sourabh is out till 9/3). As for workaround right now, customer can compile the configuration locally first and import the Mof directly into AA either from portal or PowerShell. The xSQL resource can still be imported into AA module asset so it should be available for pulling."
PowerShell/SqlServerDsc#771 (comment)

Contributor

johlju commented Sep 19, 2017

@kwirkykat @zjalexander Is there anything new around this, could you reach out to your contact again and ask for an update? Or should we just wait?

I just tested and the same problem is still there. I'm looking for if this will be possible for them to resolve, and if so, what the hard limit will be.

Last status update when @kwirkykat reached out:

We have a bug tracking the long path issue. It’s currently assigned to Sourabh’s team. (Sourabh is out till 9/3). As for workaround right now, customer can compile the configuration locally first and import the Mof directly into AA either from portal or PowerShell. The xSQL resource can still be imported into AA module asset so it should be available for pulling."
PowerShell/SqlServerDsc#771 (comment)

@cdeli

This comment has been minimized.

Show comment
Hide comment
@cdeli

cdeli Nov 1, 2017

I am having the same issue here. I am using

import-dscresource -Name xSQLServer

I have also tried

import-dscresource -ModuleName xSQLServer

I get the same error as OP every time. Using the 12GB memory example to attempt to compile it.

Exception calling "NewScriptBlock" with "1" argument(s): "At line:13 char:1
+ import-dscresource -Name xSQLServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unable to load resource 'xSQLServer': Resource not found.
At line:17 char:9
+ Service Gateway
+ ~~~~~~~ Undefined DSC resource 'Service'. Use Import-DSCResource to import the resource.
At line:25 char:9
+ xSQLServerMemory Set_SQLServerMaxMemory_To12GB
+ ~~~~~~~~~~~~~~~~ Undefined DSC resource 'xSQLServerMemory'. Use Import-DSCResource to import the resource." (At line:13 char:1
+ import-dscresource -Name xSQLServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unable to load resource 'xSQLServer': Resource not found.
At line:17 char:9
+ Service Gateway
+ ~~~~~~~ Undefined DSC resource 'Service'. Use Import-DSCResource to import the resource
At line:25 char:9
+ xSQLServerMemory Set_SQLServerMaxMemory_To12GB
+ ~~~~~~~~~~~~~~~~ Undefined DSC resource 'xSQLServerMemory'. Use Import-DSCResource to import the resource.)

cdeli commented Nov 1, 2017

I am having the same issue here. I am using

import-dscresource -Name xSQLServer

I have also tried

import-dscresource -ModuleName xSQLServer

I get the same error as OP every time. Using the 12GB memory example to attempt to compile it.

Exception calling "NewScriptBlock" with "1" argument(s): "At line:13 char:1
+ import-dscresource -Name xSQLServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unable to load resource 'xSQLServer': Resource not found.
At line:17 char:9
+ Service Gateway
+ ~~~~~~~ Undefined DSC resource 'Service'. Use Import-DSCResource to import the resource.
At line:25 char:9
+ xSQLServerMemory Set_SQLServerMaxMemory_To12GB
+ ~~~~~~~~~~~~~~~~ Undefined DSC resource 'xSQLServerMemory'. Use Import-DSCResource to import the resource." (At line:13 char:1
+ import-dscresource -Name xSQLServer
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unable to load resource 'xSQLServer': Resource not found.
At line:17 char:9
+ Service Gateway
+ ~~~~~~~ Undefined DSC resource 'Service'. Use Import-DSCResource to import the resource
At line:25 char:9
+ xSQLServerMemory Set_SQLServerMaxMemory_To12GB
+ ~~~~~~~~~~~~~~~~ Undefined DSC resource 'xSQLServerMemory'. Use Import-DSCResource to import the resource.)

@johlju

This comment has been minimized.

Show comment
Hide comment
@johlju

johlju Mar 14, 2018

Contributor

This is resolved when the SqlServerDsc (previously xSQLServer) resource module was released to the PowerShell Gallery.

Closing this issue.

Contributor

johlju commented Mar 14, 2018

This is resolved when the SqlServerDsc (previously xSQLServer) resource module was released to the PowerShell Gallery.

Closing this issue.

@johlju johlju closed this Mar 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment