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

Project scheduled trigger read failure #740

Open
hans-m-song opened this issue Aug 15, 2024 · 1 comment · May be fixed by #841
Open

Project scheduled trigger read failure #740

hans-m-song opened this issue Aug 15, 2024 · 1 comment · May be fixed by #841
Labels
kind/bug Something isn't working triage/potentially-stale Issues that are old and may have been fixed in more recent provider versions. Needs re-validating.

Comments

@hans-m-song
Copy link

Describe the bug
A clear and concise description of what the bug is.

The provider cannot find project triggers once created or when attempting to import. It fails with the error

Octopus API error: Resource is not found or it doesn't exist in the current space context. Please contact your administrator for more information. []

Steps to reproduce

  1. Define a scheduled project trigger
    resource "octopusdeploy_project_scheduled_trigger" "foo" {
      name       = "foo"
      project_id = "Projects-2024"
      space_id   = "Spaces-202"
      run_runbook_action {
        runbook_id             = "Runbooks-865"
        target_environment_ids = ["Environments-366"]
      }
      cron_expression_schedule {
        cron_expression = "0 0 * * *" # daily
      }
    }
  2. Attempt to plan
    terraform plan -target=octopusdeploy_project_scheduled_trigger.foo
    or attempt to import
    terraform import octopusdeploy_project_scheduled_trigger.foo ProjectTriggers-103
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

The provider succeeds in discovering the scheduled project trigger

Logs and other supporting information
Add the output of running tf plan or tf apply along with any errors in the Octopus Server logs.

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Warning: Resource targeting is in effect
│
│ You are creating a plan with the -target option, which means that the result of this plan may not represent all
│ of the changes requested by the current configuration.
│
│ The -target option is not for routine use, and is provided only for exceptional situations such as recovering
│ from errors or mistakes, or when Terraform specifically suggests to use it as part of an error message.
╵
╷
│ Error: Octopus API error: Resource is not found or it doesn't exist in the current space context. Please contact your administrator for more information. []
│
│   with octopusdeploy_project_scheduled_trigger.sandbox_cleanup_report,
│   on projects_administration.tf line 108, in resource "octopusdeploy_project_scheduled_trigger" "sandbox_cleanup_report":
│  108: resource "octopusdeploy_project_scheduled_trigger" "sandbox_cleanup_report" {
│
╵

Screenshots
If applicable, add screenshots to help explain your problem.

N/A

Environment and versions:

  • OS: Linux, OSX
  • Octopus Server Version: 2024.3.10026
  • Terraform Version: 1.8.2
  • Octopus Terraform Provider Version: 0.18.1

Additional context
Add any other context about the problem here.

It doesn't appear newer versions of the provider have touched this resource but I have not upgraded as the migration to tenant_project resources is a breaking change which is going to require a fair amount of work

@mjhilton mjhilton added kind/bug Something isn't working triage/potentially-stale Issues that are old and may have been fixed in more recent provider versions. Needs re-validating. labels Sep 30, 2024
@mjhilton
Copy link
Contributor

Labelling with triage/potentially-stale because of the version that this bug was repro'd in. I'd like us to repro on the latest version to confirm the behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/potentially-stale Issues that are old and may have been fixed in more recent provider versions. Needs re-validating.
Projects
None yet
2 participants