Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

ENOENT error in azure vm docker create (on windows) #1340

Closed
ahmetb opened this issue Aug 26, 2014 · 19 comments
Closed

ENOENT error in azure vm docker create (on windows) #1340

ahmetb opened this issue Aug 26, 2014 · 19 comments

Comments

@ahmetb
Copy link
Contributor

ahmetb commented Aug 26, 2014

I just made a clean installation of Node.js on Windows and azure-cli through npm.

C:\Users\ahmetb>azure vm docker create -z extrasmall -e 22 -s 041b0c0f-a2c3-4617-b5b1-4da7679d7255 -l 'West US' alp-docker3 b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140724-en-us-30GB azureuser '$SomePassword'
info:    Executing command vm docker create
+ Generating docker certificates.
error:   spawn ENOENT
info:    Error information has been recorded to azure.err

azure.err:

Mon Aug 25 2014 22:33:42 GMT-0700 (Pacific Daylight Time):
{ [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' }
Error: spawn ENOENT
    at errnoException (child_process.js:1001:11)
    at Process.ChildProcess._handle.onexit (child_process.js:792:34)

The command creates the .docker folder under my home directory (c:\users\ahmetb) but it is empty.

@guangyang
Copy link
Contributor

@babumuralidharan @eduardkoller can you guys take a look?

@bobbyrat
Copy link

yes, I suffered same problem on China Azure. I wonder if it's China Azure specific, or it also happens on global Azure.

@dtzar
Copy link

dtzar commented Oct 25, 2014

I also experienced the same problem using the xplat CLI tools installed fresh today. In AzureCloud, NOT China. Any ideas on how to fix?

@bobbyrat
Copy link

I got support from Azure who still looking into this issue. as workaround xplat CLI on linux works well (my issue was on win8.1).

@joernboeger
Copy link

I have the same problem under virtualized Windows Server 2012 R2

azure.err

Wed Nov 05 2014 22:24:40 GMT+0100 (W. Europe Standard Time):
{ [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' }
Error: spawn ENOENT
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)

@bhaskar39
Copy link

I too facing the same issue while creating the docker vm
the following is the Inpout and Output

azure vm docker create --location 'North Europe' -e 22 --vm-size 'small' --vm-name 'myvm' docker
vmcs00001 'b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140724-en-us-30GB' myname "Sample123#"
and the error is:
info: Executing command vm docker create

  • Generating docker certificates.
    error: spawn ENOENT
    info: Error information has been recorded to azure.err
    and the .docker dir is been created in my local pc user profile.

@iwate
Copy link

iwate commented Dec 7, 2014

I have same problem. My Win version is Windows Technical Preview Evaluation copy. Build 9841.

azure vm docker create iwatecker --location "Japan East" --vm-size ExternalSmall b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140414.2-en-us-30GB iwate

azure.err

Sun Dec 07 2014 14:36:46 GMT+0900 (Tokyo Standard Time):
{ [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' }
Error: spawn ENOENT
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)

@chanezon
Copy link

I think it may be linked to https://github.com/joyent/node/issues/2318​
the pb must be in

function generateDockerCertificates(cb) {

openssl.exec
and more specifically in https://github.com/mgcrea/node-openssl-wrapper/blob/master/lib/openssl-wrapper.js#L63

For short term solving:

  1. check that openssl is installed on your machine
  2. add .exe in https://github.com/mgcrea/node-openssl-wrapper/blob/master/lib/openssl-wrapper.js#L63
    var openssl = spawn('openssl.exe', params),

This bug needs to be fixed in openssl-wrapper.

@bureado
Copy link
Member

bureado commented Dec 10, 2014

openssl.exe needs to be in PATH, if you download OpenSSL for Win32 and do something like set PATH=%PATH%;c:\users\foo\downloads\openssl-x.y.z\bin the error goes away - yet now you get:

info:    Executing command vm docker create
verbose: C:\Users\foo\.docker\ca.pem file was not found
verbose: C:\Users\foo\.docker\server-cert.pem file was not found
verbose: C:\Users\foo\.docker\cert.pem file was not found
verbose: Generating docker certificates.
verbose: Loading 'screen' into random state - done
Generating RSA private key, 512 bit long modulus
.......++++++++++++
..................++++++++++++
e is 65537 (0x10001)

verbose: Unable to load config info from /usr/local/ssl/openssl.cnf

verbose: Loading 'screen' into random state - done
Generating RSA private key, 512 bit long modulus
.++++++++++++
.........++++++++++++
e is 65537 (0x10001)

verbose: Unable to load config info from /usr/local/ssl/openssl.cnf

verbose: Loading 'screen' into random state -C:\Users\foo\.docker\server.csr
: No such file or directory
 done

verbose: Loading 'screen' into random state - done
Generating RSA private key, 512 bit long modulus
.................++++++++++++
............++++++++++++
e is 65537 (0x10001)

verbose: Unable to load config info from /usr/local/ssl/openssl.cnf

verbose: Loading 'screen' into random state -C:\Users\foo\.docker\client.csr
: No such file or directory
 done

verbose: writing RSA key

verbose: writing RSA key

error:   ENOENT, no such file or directory 'C:\Users\foo\.docker\ca.pem'
verbose: stack Error: ENOENT, no such file or directory 'C:\Users\foo\.docke
r\ca.pem'
    at Object.fs.chmodSync (fs.js:821:18)
    at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\commands\asm\vm\vmcli
ent.js:3805:30
    at ChildProcess.<anonymous> (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI
\node_modules\openssl-wrapper\lib\openssl-wrapper.js:86:16)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)
info:    Error information has been recorded to azure.err

@bureado
Copy link
Member

bureado commented Dec 11, 2014

Ah, the joys of OpenSSL in Windows. So, in my specific distribution of OpenSSL (which happens to be the gnuwin32.sf.net one) here's the two set's I needed. azure-cli should test() for openssl and openssl.cfg before creating Docker's certificates (or ship OpenSSL? chan chan chaaaan)

set PATH=%PATH%;c:\users\foo\Downloads\openssl-0.9.8h-1-bin\bin
set OPENSSL_CONF=c:\Users\foo\Downloads\openssl-0.9.8h-1-bin\share\openssl.cnf
azure vm docker create ...

@iwate
Copy link

iwate commented Dec 11, 2014

@guangyang @chanezon Thank you your comments! It was a great help to me.
I installed gnuwin32 and created CA files while reference http://docs.docker.com/articles/https/
Then I have succeeded execute azure vm docker create command

@jeffmendoza
Copy link
Contributor

cc @anuchandy @hopetobelievein

@ruslangabitov
Copy link
Contributor

Added a check for OpenSSL in "create docker vm" command: https://github.com/MSOpenTech/azure-sdk-tools-xplat/commit/34deb1f8952599078bc87b20a0fb32d42f0a6304. Change will be part of PR from MSOpenTech.

@ahmetb
Copy link
Contributor Author

ahmetb commented Feb 24, 2015

@hopetobelievein can't see where it's fixed with a friendly error message or a pre-check for openssl.exe in 34deb1f.

@kmouss kmouss added the P2 label Feb 24, 2015
@johngossman
Copy link

I had the problem that Openssl was not finding a conf file. My installation is from the git bash on Windows. I fixed by setting OPENSSL_CONF to point at the openssl.cnf file in git/ssl. The check that openssl is installed by asking for version is not enough.

@sauryadas
Copy link

@amarzavery Can you please assign this to the right owner?

@amarzavery
Copy link
Contributor

@sauryadas - you are the right owner. It's an issue with the vm command and falls in your lap.

@amarzavery amarzavery added docker and removed Team labels May 3, 2016
@ahmetb ahmetb changed the title ENOENT error in azure vm docker create ENOENT error in azure vm docker create (on windows) May 3, 2016
@amarzavery amarzavery added the ASM label Jul 15, 2016
@amarzavery
Copy link
Contributor

Looks like the command works.

azure vm docker create -z Small -e 22  -l "West US" foo2345nmj b39f27a8b8c64d52b0ebad85__Ubuntu-14_04-LTS-amd64-server-20140724-en-us-30GB tp2user HelloWorld!12
info:    Executing command vm docker create
info:    Found docker client certificates.
+ Looking up image b39f27a8b8c64d52b0ebad85__Ubuntu-14_04-LTS-amd64-server-20140724-en-us-30GB
+ Looking up cloud service
info:    cloud service foo2345nmj not found.
+ Creating cloud service
+ Retrieving storage accounts
+ Creating VM
info:    vm docker create command OK

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