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

Nomad run on windows not working #1720

Closed
kubicaj opened this issue Sep 20, 2016 · 4 comments
Closed

Nomad run on windows not working #1720

kubicaj opened this issue Sep 20, 2016 · 4 comments

Comments

@kubicaj
Copy link

kubicaj commented Sep 20, 2016

Nomad version

0.4.1

Operating system and Environment details

Windows 7 64bit

Issue

When try to start simple java job on Windows then the following error occur:
Error getting job struct: Error getting jobfile from "example.nomad": remove C:\Users\kubicaj\AppDat\Local\Temp\jobfile892698331: The process cannotaccess the file because it is being used by another process.

Reproduction steps

  1. download nomad for windows
  2. start agent whit dev mode: nomad agent -dev
  3. create example.nomad file with java driver
  4. run command nomad run example.nomad

Nomad Server logs (if appropriate)

C:\Clustering\Nomad>nomad agent -dev
    No configuration files loaded
==> Starting Nomad agent...
==> Nomad agent configuration:

                 Atlas: <disabled>
                Client: true
             Log Level: DEBUG
                Region: global (DC: dc1)
                Server: true

==> Nomad agent started! Log data will stream in below:

    2016/09/20 15:38:59 [INFO] raft: Node at 127.0.0.1:4647 [Follower] entering Follower state (Leader: "")
    2016/09/20 15:38:59 [INFO] serf: EventMemberJoin: CZ408016.global 127.0.0.1
    2016/09/20 15:38:59.811886 [INFO] nomad: starting 4 scheduling worker(s) for [service batch system _core]
    2016/09/20 15:38:59.811886 [INFO] nomad: adding server CZ408016.global (Addr: 127.0.0.1:4647) (DC: dc1)
    2016/09/20 15:39:00.001897 [INFO] client: using state directory C:\Users\kubicaj\AppData\Local\Temp\NomadClient999060567
    2016/09/20 15:39:00.003897 [INFO] client: using alloc directory C:\Users\kubicaj\AppData\Local\Temp\NomadClient880820170
    2016/09/20 15:39:00.003897 [DEBUG] client: built-in fingerprints: [arch cpu env_aws env_gce host memory network nomad storage]
    2016/09/20 15:39:01 [WARN] raft: Heartbeat timeout from "" reached, starting election
    2016/09/20 15:39:01 [INFO] raft: Node at 127.0.0.1:4647 [Candidate] entering Candidate state
    2016/09/20 15:39:01 [DEBUG] raft: Votes needed: 1
    2016/09/20 15:39:01 [DEBUG] raft: Vote granted from 127.0.0.1:4647. Tally: 1
    2016/09/20 15:39:01 [INFO] raft: Election won. Tally: 1
    2016/09/20 15:39:01 [INFO] raft: Node at 127.0.0.1:4647 [Leader] entering Leader state
    2016/09/20 15:39:01.778998 [INFO] nomad: cluster leadership acquired
    2016/09/20 15:39:01 [INFO] raft: Disabling EnableSingleNode (bootstrap)
    2016/09/20 15:39:01 [DEBUG] raft: Node 127.0.0.1:4647 updated peer set (2): [127.0.0.1:4647]
    2016/09/20 15:39:01.778998 [DEBUG] leader: reconciling job summaries at index: 0
    2016/09/20 15:39:02.426035 [DEBUG] fingerprint.cpu: frequency: 2701 MHz
    2016/09/20 15:39:02.426035 [DEBUG] fingerprint.cpu: core count: 4
    2016/09/20 15:39:02.629047 [DEBUG] fingerprint.env_gce: Could not read value for attribute "machine-type"
    2016/09/20 15:39:04.110132 [DEBUG] fingerprint.network: Detected interface Wireless Network Connection with IP 192.168.31.57 during fingerprinting

    2016/09/20 15:39:05.270198 [WARN] fingerprint.network: Error calling powershell.exe (Get-NetAdapter -IncludeHidden | Where name -eq 'Wireless Netw
ork Connection' | Select -ExpandProperty LinkSpeed): exit status 1
    2016/09/20 15:39:05.270198 [DEBUG] fingerprint.network: Unable to read link speed; setting to default 100
    2016/09/20 15:39:05.270198 [DEBUG] client: applied fingerprints [arch cpu host memory network nomad storage]
    2016/09/20 15:39:05.284199 [DEBUG] driver.docker: using client connection initialized from environment
    2016/09/20 15:39:06.327259 [DEBUG] client: fingerprinting docker every 15s
    2016/09/20 15:39:06.327259 [DEBUG] client: fingerprinting exec every 15s
    2016/09/20 15:39:06.735282 [DEBUG] client: available drivers [raw_exec java]
    2016/09/20 15:39:06.739282 [DEBUG] client: updated allocations at index 1 (pulled 0) (filtered 0)
    2016/09/20 15:39:06.739282 [DEBUG] client: allocs: (added 0) (removed 0) (updated 0) (ignore 0)
    2016/09/20 15:39:06.740282 [DEBUG] client: node registration complete
    2016/09/20 15:39:06.740282 [DEBUG] client: periodically checking for node changes at duration 5s
    2016/09/20 15:39:06.745282 [DEBUG] client: state updated to ready
    2016/09/20 15:39:09.836459 [DEBUG] consul.syncer: error in syncing: 1 error(s) occurred:

* Get http://127.0.0.1:8500/v1/agent/services: dial tcp 127.0.0.1:8500: connectex: No connection could be made because the target machine actively ref
used it.

Nomad Client logs (if appropriate)

Job file (if appropriate)

example.nomad:

job "job-clientapi" {
    region = "global"
    datacenters = ["dc1"]
    update {
        stagger = "10s"
        max_parallel = 1
    }
    group "group-clientapi" {
        restart {
            attempts = 10
            interval = "5m"
            delay = "25s"
            mode = "delay"
        }
        # Define a task to run
        task "task-clientapi" {
            # Use Java to run the task.
            driver = "java"     
            config {
                jar_path = "jars/clientApi.jar"
                jvm_options = ["-Xmx2048m", "-Xms256m"]
                port_map {
                    port-service-clientapi = 7008
                }
            }
            service {
                name = "service-clientapi"
                tags = ["component", "clientapi"]
                port = "port-service-clientapi"
                check {
                    name = "alive"
                    type = "tcp"
                    interval = "10s"
                    timeout = "2s"
                }
            }   
            resources {
                cpu = 1500 # 500 MHz
                memory = 1024 # 256MB
                network {
                    mbits = 100
                    port "port-service-clientapi" {
                    }
                }
            }
        }
    }
}
@mwieczorek
Copy link
Contributor

I think it's the same problem as in #1714 (resolved in #1690)

@kubicaj Can you build from master and check?

@mwieczorek
Copy link
Contributor

@kubicaj I see in log that also network fingerprinting isn't working correctly:

2016/09/20 15:39:05.270198 [WARN] fingerprint.network: Error calling powershell.exe (Get-NetAdapter -IncludeHidden | Where name -eq 'Wireless Netw
ork Connection' | Select -ExpandProperty LinkSpeed): exit status 1

Can you run the powershell commands on the client host and check the exception?

@kubicaj
Copy link
Author

kubicaj commented Oct 2, 2016

Hi. Thanks. It works now.

Logs

D:\PROJECTS\CLUSTERS\NomadGit\nomad>nomad.exe agent -dev
    No configuration files loaded
==> Starting Nomad agent...
==> Nomad agent configuration:

                 Atlas: <disabled>
                Client: true
             Log Level: DEBUG
                Region: global (DC: dc1)
                Server: true

==> Nomad agent started! Log data will stream in below:

    2016/10/02 22:41:50 [INFO] raft: Node at 127.0.0.1:4647 [Follower] entering Follower state (Leader: "")
    2016/10/02 22:41:50 [INFO] serf: EventMemberJoin: CZ408016.global 127.0.0.1
    2016/10/02 22:41:50.210019 [INFO] nomad: starting 4 scheduling worker(s) for [service batch system _core]
    2016/10/02 22:41:50.211019 [INFO] nomad: adding server CZ408016.global (Addr: 127.0.0.1:4647) (DC: dc1)
    2016/10/02 22:41:50.338026 [INFO] client: using state directory C:\Users\kubicaj\AppData\Local\Temp\NomadClient838805619
    2016/10/02 22:41:50.339026 [INFO] client: using alloc directory C:\Users\kubicaj\AppData\Local\Temp\NomadClient673319222
    2016/10/02 22:41:50.339026 [DEBUG] client: built-in fingerprints: [arch consul cpu env_aws env_gce host memory network nomad storage vault]
    2016/10/02 22:41:51.341083 [DEBUG] client: fingerprinting consul every 15s
    2016/10/02 22:41:51 [WARN] raft: Heartbeat timeout from "" reached, starting election
    2016/10/02 22:41:51 [INFO] raft: Node at 127.0.0.1:4647 [Candidate] entering Candidate state
    2016/10/02 22:41:51 [DEBUG] raft: Votes needed: 1
    2016/10/02 22:41:51 [DEBUG] raft: Vote granted from 127.0.0.1:4647. Tally: 1
    2016/10/02 22:41:51 [INFO] raft: Election won. Tally: 1
    2016/10/02 22:41:51 [INFO] raft: Node at 127.0.0.1:4647 [Leader] entering Leader state
    2016/10/02 22:41:51.367085 [INFO] nomad: cluster leadership acquired
    2016/10/02 22:41:51 [INFO] raft: Disabling EnableSingleNode (bootstrap)
    2016/10/02 22:41:51 [DEBUG] raft: Node 127.0.0.1:4647 updated peer set (2): [127.0.0.1:4647]
    2016/10/02 22:41:51.368085 [DEBUG] leader: reconciling job summaries at index: 0
...

@kubicaj kubicaj closed this as completed Oct 2, 2016
@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 19, 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