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

Zip Decompressor not working on Windows #923

Closed
mohitarora opened this issue Mar 16, 2016 · 17 comments
Closed

Zip Decompressor not working on Windows #923

mohitarora opened this issue Mar 16, 2016 · 17 comments

Comments

@mohitarora
Copy link

Nomad version - v0.3.0

Operating system and Environment details - Windows

Issue - I am trying to run an exe using Nomad Raw Fork/Exec Driver, Artifact Source is a zip file which contains executable and its dependencies. (Job Config below). When i submit the job, i see following error on client

2016/03/16 03:38:37 [ERR] client: failed to start task 'microservice' for alloc '2ae8d6fb-9a25-c88b-8dd6-bd72973356d': Error downloading artifact: expected a single file: C:\Users\mohit\AppData\Local\Temp\2\getter672850936\archive

Job Config

job "windows-service" {
    region = "global"
    datacenters = ["dc1"]
    type = "service"
    constraint {
        attribute = "${attr.kernel.name}"
        value = "windows"
    }
    update {
        stagger = "30s"
        max_parallel = 1
    }
    group "microservices" {
        count = 1
        task "microservice" {
            driver = "raw_exec"
            config {
                artifact_source = "https://<ARTIFACT_LOCATION>/build.zip"
                command = "Host.exe"
            }
            env {
                DB_HOST = "db01.example.com"
                DB_USER = "web"
                DB_PASSWORD = "loremipsum"
            }
            resources {
                cpu = 500
                memory = 128
            }
        }
    }
}
@diptanu
Copy link
Contributor

diptanu commented Mar 16, 2016

Fixed via #921

@diptanu diptanu closed this as completed Mar 16, 2016
@diptanu
Copy link
Contributor

diptanu commented Mar 16, 2016

@mohitarora There will be support for un-archiving artifacts in Nomad 0.3.1, which will go out later tonight. The syntax for specifying artifacts has changed, so please refer the docs once we release.

@mohitarora
Copy link
Author

Thanks @diptanu, waiting for new version.

@dadgar
Copy link
Contributor

dadgar commented Mar 16, 2016

@mohitarora Just released 👍

@mohitarora
Copy link
Author

Still not working, This time not even any error reported on Client

 job "windows-service" {
    region = "global"
    datacenters = ["dc1"]
    type = "service"
    constraint {
        attribute = "${attr.kernel.name}"
        value = "windows"
    }
    update {
        stagger = "30s"
        max_parallel = 1
    }
    group "microservices" {
        count = 1
        task "microservice" {
            driver = "raw_exec"
         artifact {
                source = "https://<ARTIFACT_LOCATION>/build.zip"
          }
          config {
                command = "OwinSample.Host.exe"
           }

            env {
                DB_HOST = "db01.example.com"
                DB_USER = "web"
                DB_PASSWORD = "loremipsum"
            }
            resources {
                cpu = 500
                memory = 128
            }
        }
    }
}

@diptanu diptanu reopened this Mar 16, 2016
@dadgar
Copy link
Contributor

dadgar commented Mar 16, 2016

@mohitarora Can you post the results of nomad fs ls <alloc-id> microservices/ and nomad alloc-status <id>

@mohitarora
Copy link
Author

nomad alloc-status 92d01a33

ID              = 92d01a33
Eval ID         = 60adfc89
Name            = windows-service.microservices[0]
Node ID         = cfbe767e
Job ID          = windows-service
Client Status   = failed
Evaluated Nodes = 1
Filtered Nodes  = 0
Exhausted Nodes = 0
Allocation Time = 69.3µs
Failures        = 0

==> Task "microservice" is "dead"
Recent Events:
Time                   Type                      Description
17/03/16 03:02:24 UTC  Restarts Exceeded         Task exceeded restart policy
17/03/16 03:02:24 UTC  Failed Artifact Download  expected a single file: C:\Users\jetadmin\AppData\Local\Temp\2\getter427137768\archive
17/03/16 03:02:24 UTC  Downloading Artifacts     Client is downloading artifacts
17/03/16 03:02:09 UTC  Restarting                Task restarting in 15.171355828s
17/03/16 03:02:09 UTC  Failed Artifact Download  expected a single file: C:\Users\jetadmin\AppData\Local\Temp\2\getter851813997\archive
17/03/16 03:02:09 UTC  Downloading Artifacts     Client is downloading artifacts
17/03/16 03:01:51 UTC  Restarting                Task restarting in 17.28795657s
17/03/16 03:01:51 UTC  Failed Artifact Download  expected a single file: C:\Users\jetadmin\AppData\Local\Temp\2\getter764552646\archive
17/03/16 03:01:51 UTC  Downloading Artifacts     Client is downloading artifacts
17/03/16 03:01:51 UTC  Received                  Task received by client

==> Status
Allocation "92d01a33" status "failed" (0/1 nodes filtered)
  * Score "cfbe767e-2a3c-3534-7b70-a02cfb1da591.binpack" = 2.709732

==> Task Resources
Task: "microservice"
CPU  Memory MB  Disk MB  IOPS  Addresses
500  128        300      0

PS C:\nomad> .\nomad.exe fs ls 92d01a33 microservice

Mode        Size  Modfied Time           Name
drwxrwxrwx  0 B   17/03/16 03:01:51 UTC  local/
drwxrwxrwx  0 B   17/03/16 03:01:51 UTC  tmp/

@mohitarora
Copy link
Author

Its exactly the same error I was getting before upgrade

Before upgrade i was able to see the error in client logs but not after upgrade.

@dadgar
Copy link
Contributor

dadgar commented Mar 17, 2016

What is the exact artifact source? Obviously you can remove the host name but really want to see the extension. Also what is the contents of the artifact.

@mohitarora
Copy link
Author

@dadgar

Artifact Source: https://ARTIFACT_LOCATION/build.zip
Whats in the zip file: an .exe file and all its dependencies (In other words, zip file has around 35 files, all at first level itself)

@dadgar
Copy link
Contributor

dadgar commented Mar 18, 2016

Hmm it worked for me on a linux box. I will have to spin up a windows VM and try to reproduce

@mohitarora
Copy link
Author

Thanks I will try on a linux box in the mean time. Can you share your zip file?

Just want to compare.

@dadgar
Copy link
Contributor

dadgar commented Mar 18, 2016

I just did this to test:

$ zip artifact.zip main.go main_test.go
$ python -m SimpleHTTPServer
artifact {
     source = "http://127.0.0.1:8000/artifact.zip
}

@mohitarora
Copy link
Author

Some Success, zip file is getting extractor to task directory now. Apparently there was an issue with zip file (Still need to figure the exact problem), but exe is still giving problems, need to figure out.

Thanks

@dadgar
Copy link
Contributor

dadgar commented Mar 21, 2016

@mohitarora should we close this issue then? We can open up one related to the new problem

@mohitarora
Copy link
Author

Yes, we can close this one. 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 Dec 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants