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

CSI volumes links on the job page lead to a 404 #9249

Closed
apollo13 opened this issue Nov 2, 2020 · 7 comments · Fixed by #9355
Closed

CSI volumes links on the job page lead to a 404 #9249

apollo13 opened this issue Nov 2, 2020 · 7 comments · Fixed by #9355
Assignees
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/storage theme/ui type/bug

Comments

@apollo13
Copy link
Contributor

apollo13 commented Nov 2, 2020

Nomad version

0.12.5

Issue

I managed to mount a CSI volume and it shows up properly under the job volume requirements in the UI:
image
Now the link in the first column leads to: https://nomad.infra.domain/ui/csi/volumes/test while I think it should lead to https://nomad.infra.domain/ui/csi/volumes/wiki

The first name (test) is the named as specified in the job file:

    volume "test" {
      type      = "csi"
      read_only = false
      source    = "wiki"
    }

but the CSI name is the name from the source column.

Reproduction steps

Create a job using a volume that has a different name than it's source

Job file (if appropriate)

job "infra.test" {
  datacenters = ["dc1"]

  group "test" {
    volume "test" {
      type      = "csi"
      read_only = false
      source    = "wiki"
    }


    task "ubuntu" {
      driver = "docker"
      volume_mount {
       volume      = "test"
       destination = "/test"
       read_only   = false
      }

      config {
        image = "ubuntu:20.04"
        command = "sleep"
	args = ["infinity"]
      }
    }

  }
}
@tgross
Copy link
Member

tgross commented Nov 2, 2020

Hi @apollo13!

I was able to confirm this behavior on the task group page (ex. http://localhost:4646/ui/jobs/example/cache) for both 0.12.5 and the current master

I was also able to confirm this behavior on the individual allocation page (ex. http://localhost:4646/ui/allocations/09965ad4-a4b8-261b-6b01-03dcb77b473e ), in which case the screenshot for that section looks like this:

Screen Shot 2020-11-02 at 2 12 44 PM

@tgross
Copy link
Member

tgross commented Nov 2, 2020

Ok, so I've narrowed down what's happening here. Here's my volume registration:

id = "test-volume0"
type = "csi"
external_id = "EXTERNAL_ID"
plugin_id = "hostpath-plugin0"
access_mode = "single-node-writer"
attachment_mode = "file-system"

And the relevant part of the jobspec:

job "example" {

  group "cache" {
    volume "myvolume" {
      type   = "csi"
      source = "test-volume0"
    }

    task "redis" {
      volume_mount {
        volume      = "myvolume"
        destination = "${NOMAD_ALLOC_DIR}/test"
      }
    }
  }
}

But when I hit the allocations API that's populating this data:

$ curl -s http://localhost:4646/v1/allocation/:alloc_id | jq '.Job.TaskGroups[0].Volumes'
{
  "myvolume": {
    "MountOptions": null,
    "Name": "myvolume",
    "ReadOnly": false,
    "Source": "test-volume0",
    "Type": "csi"
  }
}

So the API is returning myvolume as the name of the volume within the task group. But that's not how you query for a volume (ref API). These two UI sections should both be populating the URL of the link with the source and not the name of the volume. I think the allocation page has the nicest way of showing that -- it's showing both the bolded name and the link to the real volume, but the link we construct is wrong.

I definitely tested this out a bunch... using a volume name in the task group that was a valid prefix for the real volume name! (ex. test is a valid prefix of test-volume). 🤦

@tgross tgross added theme/storage stage/accepted Confirmed, and intend to work on. No timeline committment though. and removed stage/needs-investigation labels Nov 2, 2020
@tgross
Copy link
Member

tgross commented Nov 9, 2020

See also: #9297, which suggests the issue is somewhere in the API and not the UI.

I'll self-assign this issue and follow-up if it turns out to coincidentally be a problem in both the CLI and the UI by accident, and I can't manage to do the tiny UI PR myself.

@tgross
Copy link
Member

tgross commented Nov 13, 2020

I have a patch up for both this and the nomad alloc status -verbose fix (#9354 #9355), which turned out to be coincidentally the same bug in both the CLI and UI and not the API after all.

@tgross
Copy link
Member

tgross commented Nov 13, 2020

Fixed in #9355 and this will ship in 1.0

@apollo13
Copy link
Contributor Author

Lovely, thanks!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/storage theme/ui type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants