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

Updating Settings.json and Pull pipeline fails. #699

Closed
BoostSebastian opened this issue Nov 8, 2022 · 16 comments · Fixed by #748
Closed

Updating Settings.json and Pull pipeline fails. #699

BoostSebastian opened this issue Nov 8, 2022 · 16 comments · Fixed by #748
Labels
enhancement New feature or request

Comments

@BoostSebastian
Copy link

Updating Setting.json and Pull pipeline fails.

Using latest files from repo and tried to specify to use 1.9 of AzOps.

When going from setting.json:

            "Core.SkipPim": true,
            "Core.SkipPolicy": false,
            "Core.SkipResource": true,
            "Core.SkipChildResource": true,
            "Core.SkipResourceGroup": false,

to

            "Core.SkipPim": true,
            "Core.SkipPolicy": false,
            "Core.SkipResource": false,
            "Core.SkipChildResource": true,
            "Core.SkipResourceGroup": false,

or

            "Core.SkipPim": true,
            "Core.SkipPolicy": false,
            "Core.SkipResource": false,
            "Core.SkipChildResource": false,
            "Core.SkipResourceGroup": false,

I end up with the following error message and can't work around it:

Where-Object: The term 'Where-Object' is not recognized as a name of a cmdlet, function,
script file, or executable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.

It is always stopping at Initialize step but at different amount of time, all from 4 minutes to 10 minutes
Steps to reproduce

  1. Can't reproduce, happends everytime I try to redo the steps.

steps

@BoostSebastian BoostSebastian changed the title Updating Setting.json and Pull pipeline fails. Updating Settings.json and Pull pipeline fails. Nov 8, 2022
@daltondhcp
Copy link
Contributor

Hi Sebastian,

Just tried in my own environment with the same settings and are unable to reproduce the issue. Have you made any other changes to the settings file? Can you share some more context on at what resource/scope it is trying to discover when it fails?

/Johan

@daltondhcp daltondhcp added the waiting-for-response Maintainers have replied and are awaiting a response from the bug/issue/feature creator label Nov 9, 2022
@BenjaminEngeset
Copy link

Same here. In general getting a lot of different exceptions on the Initialize task. Different errors and different timespans. Happends on most of the AzOps installations.

image

image

image

image

image

image

settings.json:

{
    "Version": 1,
    "DynamicTree": {
        "AzOps": {
            "Core.AutoGeneratedTemplateFolderPath": ".",
            "Core.AutoInitialize": true,
            "Core.DefaultDeploymentRegion": "westeurope",
            "Core.EnrollmentAccountPrincipalName": "",
            "Core.ExcludedSubOffer": [
                "AzurePass_2014-09-01",
                "FreeTrial_2014-09-01",
                "AAD_2015-09-01"
            ],
            "Core.ExcludedSubState": [
                "Disabled",
                "Deleted",
                "Warned",
                "Expired"
            ],
            "Core.ExportRawTemplate": false,
            "Core.IgnoreContextCheck": false,
            "Core.IncludeResourcesInResourceGroup": ["*"],
            "Core.IncludeResourceType": ["*"],
            "Core.InvalidateCache": true,
            "Core.OfferType": "MS-AZR-0017P",
            "Core.PartialMgDiscoveryRoot": [],
            "Core.SkipPim": true,
            "Core.SkipPolicy": false,
            "Core.SkipResource": false,
            "Core.SkipChildResource": false,
            "Core.SkipResourceGroup": false,
            "Core.SkipResourceType": [
                "microsoft.alertsmanagement/smartDetectorAlertRules",
                "Microsoft.PowerPlatform/accounts",
                "Microsoft.PowerPlatform/enterprisePolicies",
                "microsoft.visualstudio/account",
                "Microsoft.VSOnline/plans",
                "Microsoft.Insights/scheduledQueryRules"
            ],
            "Core.SkipRole": false,
            "Core.SubscriptionsToIncludeResourceGroups": ["*"],
            "Core.TemplateParameterFileSuffix": ".json",
            "Core.ThrottleLimit": 10,
            "Core.WhatifExcludedChangeTypes":[
                "NoChange",
                "Ignore"
            ]
        },
        "|AzureDevOps": {
            "!Condition": "EnvAzDevPipeline -or -not OSWindows",
            "AzOps.Core.State": "%PIPELINE_WORKSPACE%/s/root"
        },
        "|GitHub": {
            "!Condition": "EnvGithubAction",
            "AzOps.Core.State": "%GITHUB_WORKSPACE%/root"
        },
        "PSFramework": {
            "Message.Info.Maximum": 3
        }
    }
}

@daltondhcp
Copy link
Contributor

Thanks for sharing @bengeset96. The last two (related to child resources), looks like a downstream issue with the Export ARM API (internal server error)
For the others, it would be great to get some more context on what specific resources/resource groups that are failing (i.e. the lines before the terminating errors appears)

To simplify debugging, if possible, please send over some example pipeline logs over email to me on jodahlbo[at]microsoft.com.

@BenjaminEngeset
Copy link

BenjaminEngeset commented Nov 9, 2022

@daltondhcp

I've sent you some logs from the various runs on your email.

Can also enable debugging on the agent if needed for further investigation.

@jsandquist
Copy link
Contributor

@BoostSebastian @bengeset96 I recognize a few of these, see #656, but after we reset the logging level to default 3 (instead of 9) and also changed the throttle limit to 1 instead of default 10 (although unsure if related at all) we no longer see this on a daily basis, but only once every week or so.

@BenjaminEngeset
Copy link

BenjaminEngeset commented Nov 15, 2022

@jsandquist

I've tried to throttle it down as well, but did not have any impact on the AzOps installations. I'll continue debugging and trying different scenarios. The larger the environment is, the more often I get it.

@daltondhcp
Copy link
Contributor

Update: In 1.9.1, we introduced error handling to handle the "Internal Server Error" issues thrown from the ExportResources API. Please let us know if you observe improvements in the situation.

@BoostSebastian
Copy link
Author

@daltondhcp I tried today to reimplement everything from scratch but exactly the same error.

Test-Path: Value cannot be null. (Parameter 'The provided Path argument was null or an empty collection.')

##[error]PowerShell exited with code '1'.
Finishing: Initialize

This happends right after our resource group with Exchange 2019 servers pool
This is maybe 4/10 and the rest at what I can only assume is random

@daltondhcp
Copy link
Contributor

@daltondhcp I tried today to reimplement everything from scratch but exactly the same error.

Test-Path: Value cannot be null. (Parameter 'The provided Path argument was null or an empty collection.')

##[error]PowerShell exited with code '1'.
Finishing: Initialize

This happends right after our resource group with Exchange 2019 servers pool This is maybe 4/10 and the rest at what I can only assume is random

This looks like a completely different error, right?

@BoostSebastian
Copy link
Author

BoostSebastian commented Dec 2, 2022

@daltondhcp I don't know, getting different errors each time I run the Pipeline and at different lines.
Here is four runs in a row.
Using 1.9.1.

Greenshot 2022-12-01 15 44 39

Greenshot 2022-12-01 16 16 28

Greenshot 2022-12-01 16 49 52

Greenshot 2022-12-02 06 57 43

@BenjaminEngeset
Copy link

We're having the same issues as I can tell @BoostSebastian. I have spent quite much time troubleshooting, but still not any closer.

Johan has been kind and I have sent some logs, but they did not tell much.

Starting from scratch with blank repository state and different agent has not helped.

@BoostSebastian
Copy link
Author

@BenjaminEngeset, I tried a blank repo but no success. I could back it up to 1.7 but same error again when changing to include resources and child-resources.

This seems to be the most commin error message:

Write-PSFMessage: The term 'Write-PSFMessage' is not recognized as a name of a cmdlet, function

@BoostSebastian
Copy link
Author

I have tried to run many times now.
One success and rest of the runs is failed on Initialize step.
At 1.9.1 it now always show.

Write-PSFMessage: The term 'Write-PSFMessage' is not recognized as a name of a cmdlet, function

fails

@BoostSebastian
Copy link
Author

Any Updates :) Still the same Issues.

@daltondhcp
Copy link
Contributor

Hey @BoostSebastian - sorry for the slow updates. We are aiming to ship AzOps 2.0 very soon that will introduce lots of performance improvements and also from what we've seen address the above. Keep your eyes peeled.

@BoostSebastian
Copy link
Author

@daltondhcp Souund awesome :) I will try as soon it is released.

@daltondhcp daltondhcp mentioned this issue Feb 17, 2023
5 tasks
@daltondhcp daltondhcp linked a pull request Feb 17, 2023 that will close this issue
5 tasks
@Jefajers Jefajers added enhancement New feature or request and removed waiting-for-response Maintainers have replied and are awaiting a response from the bug/issue/feature creator triage labels Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants