murphstein
murphstein

Reputation: 529

Azure CLI tool not working on CentOS 6.3 (cannot find /usr/bin/node) -- workarounds?

Just installed node.JS so I could install the Azure cmd line tools on a CentOS 6.3 machine. According to this, there's a problem with 'azure' invoking 'node' (per strace). Since MSFT doesn't support Azure at all, apparently, I'm wondering who gets bug reports like this, and does anyone else have a solution?

[murphstein@localhost ~]$ which node
/usr/bin/node
[murphstein@localhost ~]$ which azure
/usr/bin/azure
[murphstein@localhost ~]$ ls -l /usr/bin/{azure,node}
lrwxrwxrwx. 1 root root 35 Sep  8 13:57 /usr/bin/azure -> ../lib/node_modules/azure/bin/azure
lrwxrwxrwx. 1 root root  8 Sep  8 13:56 /usr/bin/node -> ./nodejs
[murphstein@localhost ~]$ strace /usr/bin/azure
execve("/usr/bin/azure", ["/usr/bin/azure"], [/* 38 vars */]) = 0
brk(0)                                  = 0x1160000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5928bd9000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=49164, ...}) = 0
mmap(NULL, 49164, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5928bcc000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\355\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1912432, ...}) = 0
mmap(NULL, 3741864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5928629000
mprotect(0x7f59287b2000, 2093056, PROT_NONE) = 0
mmap(0x7f59289b1000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x188000) = 0x7f59289b1000
mmap(0x7f59289b6000, 18600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f59289b6000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5928bcb000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5928bca000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5928bc9000
arch_prctl(ARCH_SET_FS, 0x7f5928bca700) = 0
mprotect(0x7f59289b1000, 16384, PROT_READ) = 0
mprotect(0x7f5928bda000, 4096, PROT_READ) = 0
munmap(0x7f5928bcc000, 49164)           = 0
brk(0)                                  = 0x1160000
brk(0x1181000)                          = 0x1181000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=99158576, ...}) = 0
mmap(NULL, 99158576, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5922798000
close(3)                                = 0
execve("/usr/local/bin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/bin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/bin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/local/sbin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/sbin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/sbin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
execve("/home/murphstein/bin/node\r", ["node\r", "/usr/bin/azure"], [/* 38 vars */]) = -1 ENOENT (No such file or directory)
write(2, "/usr/bin/env: ", 14/usr/bin/env: )          = 14
)                   = 5e
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2512, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5928bd8000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2512
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f5928bd8000, 4096)            = 0
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": No such file or directory", 27: No such file or directory) = 27
write(2, "\n", 1
)                       = 1
close(1)                                = 0
close(2)                                = 0
exit_group(127)                         = ?
[murphstein@localhost ~]$ 

Upvotes: 0

Views: 798

Answers (2)

Dwight Goins
Dwight Goins

Reputation: 21

I actually am using Node v0.9.0 on Gentoo.

I was getting the same error whenever I tried to run "azure". I could however cd into the azure-sdk...\bin folder then run "node azure" and it worked fine.

Afterwards I saw your post and it worked fine as well.

Thanks

Upvotes: 1

murphstein
murphstein

Reputation: 529

OK, the problem turns out to be 'azure' calling execve() with the string "/usr/bin/node\r".

A workaround is to do this:

% cd /usr/bin
% sudo ln -s ./nodejs ./node^V^M

Yes, sticking a DOS carriage return (that's Ctrl-V Ctrl-M) at the end of the filename gets you past this problem, but who knows what's going to crop up next. I was at least able to import my subscription info and 'azure' subcommands seems to be working so far.

Upvotes: 1

Related Questions