"TypeError: Cannot read properties of undefined (reading 'Properties')"

Hi Octopus team,

Hope you all are doing well.

We are getting an error " “TypeError: Cannot read properties of undefined (reading ‘Properties’)”" while accessing the process configuration in a project. It has the configuration to extract a package and upload it to the s3 bucket. We are using the inbuilt s3 sync plugin.

The whole setup is created with Terraform. From the error, we understand that it is something related to the property attribute. So pasting the all properties that we pass to the resource from Terraform.

properties = {
“Octopus.Action.Aws.AssumeRole” = “True”
“Octopus.Action.Aws.AssumedRoleArn” = “#{ASSUME_ROLE_ARN}”
“Octopus.Action.Aws.AssumedRoleSession” = trimspace(“#{Octopus.Project.Name}-${step.key}”)
“Octopus.Action.Aws.Region” = “#{AWS_REGION}”
“Octopus.Action.Aws.S3.BucketName” = “#{S3_BUCKET}”
“Octopus.Action.Aws.S3.FileSelections” = “[{"type":"MultipleFiles","tags":[],"metadata":[],"cannedAcl":"private","path":"build/index.html","storageClass":"STANDARD","bucketKey":"build/index.html","bucketKeyPrefix":"build/","bucketKeyBehaviour":"Custom","performVariableSubstitution":"False","performStructuredVariableSubstitution":"False","pattern":"build//*","variableSubstitutionPatterns":""}]"
“Octopus.Action.Aws.S3.PackageOptions” = "{"bucketKey":"","bucketKeyBehaviour":"Custom","bucketKeyPrefix":"","storageClass":"STANDARD","cannedAcl":"private","variableSubstitutionPatterns":"
/*","structuredVariableSubstitutionPatterns":"","metadata":[],"tags":[],"autoFocus":true}”
“Octopus.Action.Aws.S3.TargetMode” = “FileSelections”
“Octopus.Action.AwsAccount.UseInstanceRole” = “False”
“Octopus.Action.AwsAccount.Variable” = “#{AWS_ACCOUNT}”
“Octopus.Action.Package.DownloadOnTentacle” = “False”
}

Terraform apply is working as expected and it is successful but while we try to access the process configuration from the console we are getting this error.

Please have a look.

========= The complete error message=======

An unexpected error occurred in Octopus v2023.3.6319-hotfix.6572: "TypeError: Cannot read properties of undefined (reading 'Properties')"
in AwsUploadS3ActionEditInternal
in default
in s
in sl
in div
in div
in div
in TransitionAnimation
in div
in div
in PaperLayout
in Uy
in ExpandableContainer
in ProcessActionDetailsInternal
in ProcessActionDetails
in c
in DatabaseComponentContextProvider
in FieldErrorContextProvider
in ErrorContextProvider
in RenderWithPage
in EnhancedProcessActionDetailsPage
in div
in t
in ForwardRef
in div
in div
in ProcessSidebarLayout
in div
in TransitionAnimation
in div
in div
in PaperLayout
in div
in KeyboardHandler
in div
in FormComponent
in i
in FormPaperLayoutInternal
in Unknown
in withRouter()
in ProjectContextFormPaperLayout
in DeploymentsProcessEditorFormPaperLayout
in ProcessContextFormPaperLayout
in withRouter(ProcessContextFormPaperLayout)
in ProcessWarningActions
in ProcessErrorActions
in ProcessStepsLayout
in EnhancedProcessStepsLayout
in ProcessQueryStringController
in Unknown
in Unknown
in ProcessSearchFilterController
in c
in $u
in u
in ProcessController
in ProcessStepsLayoutLoader
in DataBaseComponent
in Unknown
in ProcessStepsLayoutDataLoader
in WithProjectDeploymentProcess
in c
in DatabaseComponentContextProvider
in FieldErrorContextProvider
in ErrorContextProvider
in RenderWithPage
in t
in t
in DatabaseComponentContextProvider
in FieldErrorContextProvider
in ErrorContextProvider
in BranchAwareRedirectInternal
in BranchAwareRedirect
in ProcessRoute
in withRouter(ProcessRoute)
in t
in t
in ErrorBoundaryInternal
in ReloadableRoute
in DeploymentsRoute
in withRouter(DeploymentsRoute)
in t
in ErrorBoundaryInternal
in ReloadableRoute
in t
in ErrorBoundaryInternal
in RouteAwareErrorBoundary
in div
in div
in i
in t
in j
in Unknown
in div
in NavigationSidebarLayout
in withRouter(NavigationSidebarLayout)
in main
in ProjectContextProvider
in ProjectLayoutInternal
in DatabaseComponentContextProvider
in FieldErrorContextProvider
in ErrorContextProvider
in jT
in SlugSafeRedirect
in withRouter(SlugSafeRedirect)
in t
in ErrorBoundaryInternal
in ReloadableRoute
in t
in ProjectRoutes
in t
in ErrorBoundaryInternal
in ReloadableRoute
in t
in t
in Suspense
in RootRoutes
in withRouter(RootRoutes)
in SpaceLoader
in WithPersistedSpace
in Connect(WithPersistedSpace)
in withRouter(Connect(WithPersistedSpace))
in div
in StandardLayoutInternal
in Connect(StandardLayoutInternal)
in t
in ErrorBoundaryInternal
in ReloadableRoute
in SecureRoute
in t
in l
in i
in i
in l
in u
in Q
in div
in rf
in QO
in t
in t
in aT
in DevToolsContextProvider
in ClientConnector
in l
in S
in iT
in PageProvider
in F
in DatabaseComponentContextProvider
in FieldErrorContextProvider
in ErrorContextProvider
in ErrorBoundaryInternal
in l
in d
in id
in App

Thanks,
Arun S Raj

Good afternoon @arun.raj,

Thank you for contacting Octopus Support and sorry to hear you are seeing errors when trying to access the process configuration in a project.

It seems you are on our Octopus Cloud offering with your instances URL being https://stayntouch.octopus.app/ is that correct?

If so would you mind if we created a Support user on your instance please so we can take a look at this for you, you don’t have to do anything your end to create the Support user, we just need your explicit permission.

If you can give us an idea of the project name too just so we can find it quickly that would be great.

Kind Regards,
Clare

Good afternoon @clare.martin,

The URL is not the one you have specified. It is “https://stayntouch-devops.octopus.app/”. Please create the support user here and have a look.
Also, the project is Octopus Deploy

Thanks,
Arun S Raj

Hi @arun.raj,

Thanks for getting back to us!

I was able to log in to your instance and access the project and all sub-pages within the project without error.
Would you be able to link the page you’re experiencing the error on, please?

Kind Regards,
Adam

Hi @adam.hollow,

The URL is; Octopus Deploy

Please click on any of the step configurations to get this error.

Thanks,
Arun S Raj

Hi @arun.raj,

Thanks a lot for confirming that.

After some investigation it seems that the packages within the deployment process are looking for a specific feed:

          "PackageId": "payments-merchant-portal#{PACKAGE_VERSION}",
          "FeedId": "Feeds-1057",

When I checked Feeds-1057 it doesn’t seem to exist in the list of external feeds but in the browser you can access it here: https://stayntouch-devops.octopus.app/api/Spaces-46/feeds/Feeds-1057 and you can see that it’s actually the internal feed for the space.

Going to this page within the app UI (Octopus Deploy) results in a similar error to what you see on the deployment process.

I believe this may be a regression/permutation of this issue: Typing 'Releases' in Search and selecting 'Octopus Server Releases (builtin)' errors out · Issue #7051 · OctopusDeploy/Issues · GitHub.

We’ll bring this to the attention of our engineers immediately who can investigate further.
Would you mind if one of our engineers accessed your instance for troubleshooting purposes?

Kind Regards,
Adam

Hi @adam.hollow ,

Please proceed.

Thanks,
Arun S Raj

Hi @adam.hollow

Any update on this? I am still seeing this error.

Thanks,
Arun S Raj

Hey @arun.raj,

Thank you for getting back to us and requesting an update, the engineers started to look at this issue a few hours ago but it was nearing the end of their working day unfortunately. They are based in Australia so when you reported this issue on Friday they had already left for their weekend so they picked this up last night when they were back in work (their Monday morning).

They have not managed to replicate this issue themselves so they think this is specific to your instance which sounds right considering what Adam found on Friday.

The engineers will continue to look at this for you when they get back to work tonight and we will get an update out to you once we have one.

I am sorry this is still causing you frustration but it does look like its specific to your instance so the engineers would need to take a look at your instance specifically and the backend database to see what the issue is.

We will keep you updated as soon as we know anything, reach out in the meantime if you have any other questions or notice other issues and we will do our best to help.

Kind Regards,
Clare

@clare.martin,

Thanks for the update. Looking for a resolution at the earliest!

Thanks,
Arun S Raj

1 Like

Hi @arun.raj,

Just stepping in for Clare and Adam from the Australia based team while they’re offline.

The engineers have managed to reproduce this by including a name for package that’s being referenced once this was removed the error went away:

Could you please confirm how you are creating this project in Terraform? I have a feeling it might be due to using step.action.package which defines a name instead of step.action.primary_package which just uses the packageId but I’ll dig into it some more and see what improvements we could make to it.

Looking forward to hearing how you get on, feel free to reach out with any questions at all!

Best Regards,

Hi @finnian.dempsey

Following is the code block which create this process.

resource "octopusdeploy_deployment_process" "app" {
  provider = octopusdeploy.space

  project_id = var.octopusdeploy_project_id

  dynamic "step" {
    for_each = local.combined_config

    content {
      condition    = "Success"
      name         = step.key
      target_roles = flatten([step.value.roles])

      action {
        name           = step.key
        action_type    = "Octopus.AwsUploadS3"
        channels       = flatten([step.value.channel_modules[var.octopusdeploy_project_name].channel_ids[[for key, value in var.environment_details : value["lifecycle"] if replace(step.key, "_", "-") == key][0]]])
        environments   = values(step.value.environment_modules[replace(step.key, "_", "-")].environment_id)
        worker_pool_id = step.value.worker_pool_id
        run_on_server  = true

        package {
          name                 = "s3-package"
          acquisition_location = "ExecutionTarget"
          feed_id              = data.octopusdeploy_feeds.built_in_feed.feeds[0].id
          package_id           = "${var.package_name}#{PACKAGE_VERSION}"
        }

        properties = {
          "Octopus.Action.Aws.AssumeRole"             = "True"
          "Octopus.Action.Aws.AssumedRoleArn"         = "#{ASSUME_ROLE_ARN}"
          "Octopus.Action.Aws.AssumedRoleSession"     = trimspace("#{Octopus.Project.Name}-${step.key}")
          "Octopus.Action.Aws.Region"                 = "#{AWS_REGION}"
          "Octopus.Action.Aws.S3.BucketName"          = "#{S3_BUCKET}"
          "Octopus.Action.Aws.S3.FileSelections"      = "[{\"type\":\"MultipleFiles\",\"tags\":[],\"metadata\":[],\"cannedAcl\":\"private\",\"path\":\"build/index.html\",\"storageClass\":\"STANDARD\",\"bucketKey\":\"build/index.html\",\"bucketKeyPrefix\":\"build/\",\"bucketKeyBehaviour\":\"Custom\",\"performVariableSubstitution\":\"False\",\"performStructuredVariableSubstitution\":\"False\",\"pattern\":\"build/**/*\",\"variableSubstitutionPatterns\":\"\"}]"
          "Octopus.Action.Aws.S3.PackageOptions"      = "{\"bucketKey\":\"\",\"bucketKeyBehaviour\":\"Custom\",\"bucketKeyPrefix\":\"\",\"storageClass\":\"STANDARD\",\"cannedAcl\":\"private\",\"variableSubstitutionPatterns\":\"**/*\",\"structuredVariableSubstitutionPatterns\":\"\",\"metadata\":[],\"tags\":[],\"autoFocus\":true}"
          "Octopus.Action.Aws.S3.TargetMode"          = "FileSelections"
          "Octopus.Action.AwsAccount.UseInstanceRole" = "False"
          "Octopus.Action.AwsAccount.Variable"        = "#{AWS_ACCOUNT}"
          "Octopus.Action.Package.DownloadOnTentacle" = "False"
        }
      }
    }
  }
}

To confirm, are you asking me to use “step.action.primary_package” instead of “step.action.package”?

Thanks,
Arun S Raj

Hi @arun.raj,

That’s correct, using step.action.primary_package is the correct method as it doesn’t provide a name parameter.

It seems the blank name parameter is what is causing the issue in our reproductions of the scenario.

Kind Regards,
Adam

@adam.hollow ,
I have tried to use primary_package instead of the package option but it gives me some error while applying terraform

Terraform code:

       resource "octopusdeploy_deployment_process" "app" {
  provider = octopusdeploy.space

  project_id = var.octopusdeploy_project_id

  dynamic "step" {
    for_each = local.combined_config

    content {
      condition    = "Success"
      name         = step.key
      target_roles = flatten([step.value.roles])

      action {
        name           = step.key
        action_type    = "Octopus.AwsUploadS3"
        channels       = flatten([step.value.channel_modules[var.octopusdeploy_project_name].channel_ids[[for key, value in var.environment_details : value["lifecycle"] if replace(step.key, "_", "-") == key][0]]])
        environments   = values(step.value.environment_modules[replace(step.key, "_", "-")].environment_id)
        worker_pool_id = step.value.worker_pool_id
        run_on_server  = true

        primary_package {
          acquisition_location = "ExecutionTarget"
          feed_id              = data.octopusdeploy_feeds.built_in_feed.feeds[0].id
          package_id           = "${var.package_name}#{PACKAGE_VERSION}"
        }

        properties = {
          "Octopus.Action.Aws.AssumeRole"             = "True"
          "Octopus.Action.Aws.AssumedRoleArn"         = "#{ASSUME_ROLE_ARN}"
          "Octopus.Action.Aws.AssumedRoleSession"     = trimspace("#{Octopus.Project.Name}-${step.key}")
          "Octopus.Action.Aws.Region"                 = "#{AWS_REGION}"
          "Octopus.Action.Aws.S3.BucketName"          = "#{S3_BUCKET}"
          "Octopus.Action.Aws.S3.FileSelections"      = "[{\"type\":\"MultipleFiles\",\"tags\":[],\"metadata\":[],\"cannedAcl\":\"private\",\"path\":\"build/index.html\",\"storageClass\":\"STANDARD\",\"bucketKey\":\"build/index.html\",\"bucketKeyPrefix\":\"build/\",\"bucketKeyBehaviour\":\"Custom\",\"performVariableSubstitution\":\"False\",\"performStructuredVariableSubstitution\":\"False\",\"pattern\":\"build/**/*\",\"variableSubstitutionPatterns\":\"\"}]"
          "Octopus.Action.Aws.S3.PackageOptions"      = "{\"bucketKey\":\"\",\"bucketKeyBehaviour\":\"Custom\",\"bucketKeyPrefix\":\"\",\"storageClass\":\"STANDARD\",\"cannedAcl\":\"private\",\"variableSubstitutionPatterns\":\"**/*\",\"structuredVariableSubstitutionPatterns\":\"\",\"metadata\":[],\"tags\":[],\"autoFocus\":true}"
          "Octopus.Action.Aws.S3.TargetMode"          = "FileSelections"
          "Octopus.Action.AwsAccount.UseInstanceRole" = "False"
          "Octopus.Action.AwsAccount.Variable"        = "#{AWS_ACCOUNT}"
          "Octopus.Action.Package.DownloadOnTentacle" = "False"
        }
      }
    }
  }
}

Please have a look.

Thanks,
Arun S Raj

Hi @adam.hollow

Please ignore my previous comment. This is fixed when I destroy the whole settings and reapplied the Terraform workspace. But not sure why it is not applied with the existing configurations in place. I doubt we can do the same in future for issues similar to this.

It seems like the error is gone and I can see the process configurations. I thank all of you for your support.

Thanks,
Arun S Raj

2 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.