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

Panic when token expires #582

Open
t0yv0 opened this issue Jan 18, 2024 · 2 comments
Open

Panic when token expires #582

t0yv0 opened this issue Jan 18, 2024 · 2 comments
Labels
awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). impact/panic This bug represents a panic or unexpected crash kind/bug Some behavior is incorrect or out of spec

Comments

@t0yv0
Copy link
Member

t0yv0 commented Jan 18, 2024

What happened?

Our CI detected a panic on what seems to be a routine token expiration issue. This is unfortunate and ideally we should be able to fail more gracefully here.

FAILED #579

Token failed verification: expired
PANIC.

   TestCreateUserTs

   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) warning: using pulumi-resource-artifactory from $PATH at /home/runner/work/pulumi-artifactory/pulumi-artifactory/bin/pulumi-resource-artifactory
  @ updating....
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 2024/01/17 22:21:50.123445 WARN RESTY
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 401 GET ***/artifactory/api/system/version
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) {
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)   "errors" : [ {
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)     "status" : 401,
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)     "message" : "Token failed verification: expired"
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)   } ]
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) }, Attempt 1
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 2024/01/17 22:21:50.123516 ERROR RESTY
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 401 GET ***/artifactory/api/system/version
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) {
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)   "errors" : [ {
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)     "status" : 401,
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)     "message" : "Token failed verification: expired"
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)   } ]
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) }
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 2024/01/17 22:21:50.123557 WARN RESTY
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 401 GET ***/artifactory/api/system/version
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) {
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)   "errors" : [ {
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)     "status" : 401,
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)     "message" : "Token failed verification: expired"
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)   } ]
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) }, Attempt 1
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 2024/01/17 22:21:50.123566 ERROR RESTY
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 401 GET ***/artifactory/api/system/version
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) {
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)   "errors" : [ {
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)     "status" : 401,
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)     "message" : "Token failed verification: expired"
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s)   } ]
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) }
   +  artifactory:index:User node-test-user creating (0s)
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) panic: runtime error: invalid memory address or nil pointer dereference
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) [signal SIGSEGV: segmentation violation code=0x1 addr=0x98 pc=0x1099784]
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) goroutine 63 [running]:
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) github.com/go-resty/resty/v2.(*Client).R(...)
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 	/home/runner/go/pkg/mod/github.com/go-resty/resty/[email protected]/client.go:443
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) github.com/jfrog/terraform-provider-shared/util.SendUsage({0x17c7c18, 0xc000ad8240}, 0x0, {0x0, 0x0}, {0xc0009ebf58, 0x1, 0x6552713233433258?})
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 	/home/runner/go/pkg/mod/github.com/jfrog/[email protected]/util/util.go:61 +0x2c4
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) github.com/jfrog/terraform-provider-shared/util.SendUsageResourceCreate({0x17c7c18, 0xc000ad8240}, 0xc0005538c0?, {0x0, 0x0}, {0x154c611?, 0xc0009ebfb8?})
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 	/home/runner/go/pkg/mod/github.com/jfrog/[email protected]/util/util.go:27 +0xef
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) created by github.com/jfrog/terraform-provider-artifactory/v10/pkg/artifactory/resource/user.(*ArtifactoryBaseUserResource).Create in goroutine 62
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) 	/home/runner/go/pkg/mod/github.com/jfrog/terraform-provider-artifactory/[email protected]/pkg/artifactory/resource/user/user_fw.go:159 +0x149
   +  artifactory:index:User node-test-user creating (0s) error: error reading from server: EOF
   +  artifactory:index:User node-test-user **creating failed** error: error reading from server: EOF
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab creating (0s) error: update failed
   +  pulumi:pulumi:Stack node-artifactory-p-it-fv-az841-7-ts-109b87ab **creating failed (0.34s)** 1 error; 2 warnings; 43 messages
  Diagnostics:
    artifactory:index:User (node-test-user):
      error: error reading from server: EOF

    pulumi:pulumi:Stack (node-artifactory-p-it-fv-az841-7-ts-109b87ab):
      warning: using pulumi-resource-artifactory from $PATH at /home/runner/work/pulumi-artifactory/pulumi-artifactory/bin/pulumi-resource-artifactory
      warning: using pulumi-resource-artifactory from $PATH at /home/runner/work/pulumi-artifactory/pulumi-artifactory/bin/pulumi-resource-artifactory
      error: update failed

      2024/01/17 22:21:50.123445 WARN RESTY
      401 GET ***/artifactory/api/system/version
      {
        "errors" : [ {
          "status" : 401,
          "message" : "Token failed verification: expired"
        } ]
      }, Attempt 1
      2024/01/17 22:21:50.123516 ERROR RESTY
      401 GET ***/artifactory/api/system/version
      {
        "errors" : [ {
          "status" : 401,
          "message" : "Token failed verification: expired"
        } ]
      }
      2024/01/17 22:21:50.123557 WARN RESTY
      401 GET ***/artifactory/api/system/version
      {
        "errors" : [ {
          "status" : 401,
          "message" : "Token failed verification: expired"
        } ]
      }, Attempt 1
      2024/01/17 22:21:50.123566 ERROR RESTY
      401 GET ***/artifactory/api/system/version
      {
        "errors" : [ {
          "status" : 401,
          "message" : "Token failed verification: expired"
        } ]
      }
      panic: runtime error: invalid memory address or nil pointer dereference
      [signal SIGSEGV: segmentation violation code=0x1 addr=0x98 pc=0x1099784]
      goroutine 63 [running]:
      github.com/go-resty/resty/v2.(*Client).R(...)
      	/home/runner/go/pkg/mod/github.com/go-resty/resty/[email protected]/client.go:443
      github.com/jfrog/terraform-provider-shared/util.SendUsage({0x17c7c18, 0xc000ad8240}, 0x0, {0x0, 0x0}, {0xc0009ebf58, 0x1, 0x6552713233433258?})
      	/home/runner/go/pkg/mod/github.com/jfrog/[email protected]/util/util.go:61 +0x2c4
      github.com/jfrog/terraform-provider-shared/util.SendUsageResourceCreate({0x17c7c18, 0xc000ad8240}, 0xc0005538c0?, {0x0, 0x0}, {0x154c611?, 0xc0009ebfb8?})
      	/home/runner/go/pkg/mod/github.com/jfrog/[email protected]/util/util.go:27 +0xef
      created by github.com/jfrog/terraform-provider-artifactory/v10/pkg/artifactory/resource/user.(*ArtifactoryBaseUserResource).Create in goroutine 62
      	/home/runner/go/pkg/mod/github.com/jfrog/terraform-provider-artifactory/[email protected]/pkg/artifactory/resource/user/user_fw.go:159 +0x149

  Resources:
      + 1 created

Example

See above

Output of pulumi about

N/A

Additional context

N/A

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@t0yv0 t0yv0 added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jan 18, 2024
@iwahbe
Copy link
Member

iwahbe commented Jan 18, 2024

It looks like this is a panic in a library used by the upstream provider. What do you suggest we change here?

@iwahbe iwahbe added impact/panic This bug represents a panic or unexpected crash and removed needs-triage Needs attention from the triage team labels Jan 18, 2024
@t0yv0
Copy link
Member Author

t0yv0 commented Jan 18, 2024

Yeah exactly, I don't know how to resolve this, but I'm logging that our users may receive this panic.

@iwahbe iwahbe added the awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). impact/panic This bug represents a panic or unexpected crash kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants