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

task tpi command not found #262

Closed
dacbd opened this issue Nov 23, 2021 · 5 comments · Fixed by #263
Closed

task tpi command not found #262

dacbd opened this issue Nov 23, 2021 · 5 comments · Fixed by #263
Assignees
Labels
bug Something isn't working p0-critical Max priority (ASAP) resource-task iterative_task TF resource

Comments

@dacbd
Copy link
Contributor

dacbd commented Nov 23, 2021

Did I do something completely wrong?

main.tf

terraform {
  required_providers {
    iterative = {
      source = "iterative/iterative"
    }
  }
}
provider "iterative" {}

resource "iterative_task" "task" {
  name = "test"
  cloud = "gcp"
  region = "us-west"
  machine = "m"
  disk_size= 30
  image = "ubuntu"
  directory = ""
  script = file("script.sh")
}

script.sh

#!/bin/bash

echo "hello world" > greeting.txt

error

    logs            = [
        <<-EOT
            -- Logs begin at Tue 2021-11-23 19:30:42 UTC, end at Tue 2021-11-23 19:31:26 UTC. --
            Nov 23 19:31:16 tpi-test-189gt4x-1q5wad0-m7g9 systemd[1]: Started tpi-task.service.
            Nov 23 19:31:16 tpi-test-189gt4x-1q5wad0-m7g9 bash[1591]: /bin/bash: tpi: command not found
            Nov 23 19:31:16 tpi-test-189gt4x-1q5wad0-m7g9 systemd[1]: tpi-task.service: Control process exited, code=exited, status=127/n/a
            Nov 23 19:31:16 tpi-test-189gt4x-1q5wad0-m7g9 systemd[1]: tpi-task.service: Failed with result 'exit-code'.
        EOT,
    ]

failed here I think:

curl --location --remote-name https://github.com/iterative/terraform-provider-iterative/releases/latest/download/terraform-provider-iterative_linux_amd64

some log barf: (different than the run from above but same error/logs)

root@tpi-test-189gt4x-1q5wad0-1jg9:/var/log# journalctl -n 1000 --unit=google-startup-scripts.service
-- Logs begin at Tue 2021-11-23 20:05:04 UTC, end at Tue 2021-11-23 20:18:45 UTC. --
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 systemd[1]: Starting Google Compute Engine Startup Scripts...
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 systemd[1]: Starting Google Compute Engine Startup Scripts...
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: 2021/11/23 20:05:26 GCEMetadataScripts: Starting startup scripts (version 20210629.00-0ubuntu1~20.04.0).
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 systemd[1]: Starting Google Compute Engine Startup Scripts...
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: 2021/11/23 20:05:26 GCEMetadataScripts: Starting startup scripts (version 20210629.00-0ubuntu1~20.04.0).
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 systemd[1]: Starting Google Compute Engine Startup Scripts...
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: 2021/11/23 20:05:26 GCEMetadataScripts: Starting startup scripts (version 20210629.00-0ubuntu1~20.04.0).
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: 2021/11/23 20:05:26 GCEMetadataScripts: Found startup-script in metadata.
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1470]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mkdir --parents /tmp/tpi-task
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1470]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1470]: pam_unix(sudo:session): session closed for user root
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 systemd[1]: Starting Google Compute Engine Startup Scripts...
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: 2021/11/23 20:05:26 GCEMetadataScripts: Starting startup scripts (version 20210629.00-0ubuntu1~20.04.0).
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: 2021/11/23 20:05:26 GCEMetadataScripts: Found startup-script in metadata.
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1470]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mkdir --parents /tmp/tpi-task
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1470]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1470]: pam_unix(sudo:session): session closed for user root
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1477]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /usr/bin/tpi-task
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1477]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1477]: pam_unix(sudo:session): session closed for user root
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1481]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /tmp/tpi-environment
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1481]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1481]: pam_unix(sudo:session): session closed for user root
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1496]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /etc/systemd/system/tpi-task.service
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1496]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1496]: pam_unix(sudo:session): session closed for user root
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: 2021/11/23 20:05:26 GCEMetadataScripts: startup-script:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: 2021/11/23 20:05:26 GCEMetadataScripts: startup-script:                                  Dload  Upload   Total   Spent    Left  Speed
Nov 23 20:05:26 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: [214B blob data]
Nov 23 20:05:27 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: [135B blob data]
Nov 23 20:05:27 tpi-test-189gt4x-1q5wad0-1jg9 google_metadata_script_runner[1457]: 2021/11/23 20:05:27 logging client: rpc error: code = Unauthenticated desc = transport: metadata: GCE metadata "instance/service-accounts/default>
Nov 23 20:05:31 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: [530B blob data]
Nov 23 20:05:31 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1501]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mv terraform-provider-tpi* /usr/bin/tpi
Nov 23 20:05:31 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1501]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 23 20:05:31 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: 2021/11/23 20:05:31 GCEMetadataScripts: startup-script: mv: cannot stat 'terraform-provider-tpi*': No such file or directory
Nov 23 20:05:31 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1501]: pam_unix(sudo:session): session closed for user root
Nov 23 20:05:31 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1503]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/chmod u=rwx,g=rx,o=rx /usr/bin/tpi
Nov 23 20:05:31 tpi-test-189gt4x-1q5wad0-1jg9 sudo[1503]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 23 20:05:31 tpi-test-189gt4x-1q5wad0-1jg9 GCEMetadataScripts[1457]: 2021/11/23 20:05:31 GCEMetadataScripts: startup-script: chmod: cannot access '/usr/bin/tpi': No such file or directory
...
@dacbd
Copy link
Contributor Author

dacbd commented Nov 23, 2021

terraform-provider-iterative_linux_amd64 is fully downloaded at /

@dacbd
Copy link
Contributor Author

dacbd commented Nov 23, 2021

curl --location --remote-name https://github.com/iterative/terraform-provider-iterative/releases/latest/download/terraform-provider-iterative_linux_amd64
sudo mv terraform-provider-tpi* /usr/bin/tpi

should be?

curl --location --remote-name https://github.com/iterative/terraform-provider-iterative/releases/latest/download/terraform-provider-iterative_linux_amd64
sudo mv terraform-provider-iterative* /usr/bin/tpi

@0x2b3bfa0
Copy link
Member

Yes! This is a find–and–replace bug of inconmensurable proportions. 🙈 Sorry!

@0x2b3bfa0
Copy link
Member

@dacbd, feel free to open a pull request with the fix.

@dacbd
Copy link
Contributor Author

dacbd commented Nov 23, 2021

NP Im testing it right now 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p0-critical Max priority (ASAP) resource-task iterative_task TF resource
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants