Quick Start scripts cannot locate Fuel ISO in 'iso' directory when executed inside Cygwin

Bug #1393557 reported by Julia Varigina
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Serhii Ovsianikov
6.0.x
Fix Committed
High
Serhii Ovsianikov
6.1.x
Fix Committed
High
Serhii Ovsianikov

Bug Description

Steps to reproduce:
1. Install Cygwin64 Terminal
2. Download Quick Start scripts vbox-scripts-5.1 from https://software.mirantis.com/quick-start/
3. Download Fuel iso and place it in virtualbox\iso folder
4. Run Quick Start scripts inside Cygwin

Expected result:
Scripts create virtual machines

Actual Result:
Scripts print error message:
Checking for Mirantis OpenStack ISO image... Mirantis OpenStack image is not found. Please download it and put under 'iso' directory.

Workaround:
Edit all the *.sh scripts. Find all the 'source foo/bar.sh' and replace them with 'source ./foo/bar.sh'

Changed in fuel:
assignee: nobody → Miroslav Anashkin (manashkin)
Changed in fuel:
importance: Undecided → High
milestone: none → 6.0
Revision history for this message
Miroslav Anashkin (manashkin) wrote :

Yes, if current directory mismatch with the directory, where launch.sh is placed, relative paths may not work.

Changed in fuel:
status: New → Triaged
assignee: Miroslav Anashkin (manashkin) → Serhiy Ovsianikov (sovsianikov)
Revision history for this message
Julia Varigina (jvarigina) wrote :

I executed launch.sh from the directory where it is placed.

Below is the detailed transcript of what I have done.

### Quick Start scripts are placed in /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/
$ cd /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/

123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$ ls .
actions config.sh.bak iso launch_16GB.sh launch_8GB.sh
config.sh functions launch.sh launch_4GB.sh README.md

### Fuel ISO is placed into iso folder
123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$ ls ./iso/
MirantisOpenStack-5.1.iso README.md

### Start launch.sh from the directory where it is installed
### It prints error message
123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$ ./launch.sh
Load properties from file /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/actions/../config//config.properties
sed: невозможно прочитать /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/actions/../config//config.properties: No such file or directory
sed: невозможно прочитать /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/actions/../config//config.properties: No such file or directory
sed: невозможно прочитать /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/actions/../config//config.properties: No such file or directory
sed: невозможно прочитать /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/actions/../config//config.properties: No such file or directory
Checking for 'expect'... OK
If you run this script under Cygwin, you may have to add path to VirtualBox directory to your PATH.
Usually it is enough to run "export PATH=$PATH:"/cygdrive/c/Program Files/Oracle/VirtualBox"
Checking for "VBoxManage"... OK
Checking for VirtualBox Extension Pack... OK
Checking for Mirantis OpenStack ISO image... Mirantis OpenStack image is not found. Please download it and put under 'iso' directory.

### Replace expressions like "source foo/bar.sh" with "source ./foo/bar.sh" in all the sh scripts (added "./")
123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$ find . -type f -name "*.sh" -exec sed 's/source /source .\//' -i {} \;

### Run launch.sh again
### This time it works as expected
123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$ ./launch.sh
Checking for 'expect'... OK
If you run this script under Cygwin, you may have to add path to VirtualBox directory to your PATH.
Usually it is enough to run "export PATH=$PATH:"/cygdrive/c/Program Files/Oracle/VirtualBox"
Checking for "VBoxManage"... OK
Checking for VirtualBox Extension Pack... OK
Checking for Mirantis OpenStack ISO image... OK
Going to use Mirantis OpenStack ISO file iso/MirantisOpenStack-5.1.iso
Checking if SSH client installed...
OK
Checking if ipconfig or ifconfig installed...
OK
Setup is done.
### The rest of the output is omitted

summary: - Quick Start scripts do not work inside Cygwin
+ Quick Start scripts cannot locate Fuel ISO in 'iso' directory when
+ executed inside Cygwin
Revision history for this message
Serhii Ovsianikov (sovsianikov) wrote :

I've just reproduced the steps you provided and I received another results. On my environment scripts successfully created necessary virtual machines.

Could you please execute following commands on your environment and let us know the results:
> cd /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/
> ls -aRl
> uname -a

Also, could you please let us know which type and version of operating system do you use?

Revision history for this message
Julia Varigina (jvarigina) wrote :

123@123-VAIO ~
$ cd /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/

123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$ ls -aRl
.:
итого 28
d---------+ 1 123 None 0 ноя 20 15:13 .
d---------+ 1 123 None 0 ноя 20 14:28 ..
d---------+ 1 123 None 0 ноя 20 15:13 actions
----------+ 1 123 None 6751 ноя 20 15:13 config.sh
----------+ 1 123 None 7001 окт 28 14:51 config.sh.bak
d---------+ 1 123 None 0 ноя 20 15:13 functions
d---------+ 1 123 None 0 ноя 20 14:22 iso
----------+ 1 123 None 1338 ноя 20 15:13 launch.sh
----------+ 1 123 None 44 ноя 20 15:13 launch_16GB.sh
----------+ 1 123 None 43 ноя 20 15:13 launch_4GB.sh
----------+ 1 123 None 43 ноя 20 15:13 launch_8GB.sh
----------+ 1 123 None 526 сен 23 18:08 README.md

./actions:
итого 56
d---------+ 1 123 None 0 ноя 20 15:13 .
d---------+ 1 123 None 0 ноя 20 15:13 ..
----------+ 1 123 None 1089 ноя 20 15:13 clean-previous-installation.sh
----------+ 1 123 None 1083 сен 23 17:08 clean-previous-installation.sh.bak
----------+ 1 123 None 1248 ноя 20 15:13 create-interfaces.sh
----------+ 1 123 None 1242 сен 23 17:08 create-interfaces.sh.bak
----------+ 1 123 None 1800 ноя 20 15:13 master-node-create-and-install.sh
----------+ 1 123 None 1794 сен 23 17:08 master-node-create-and-install.sh.bak
----------+ 1 123 None 1359 ноя 20 15:13 master-node-enable-internet.sh
----------+ 1 123 None 1353 сен 23 17:08 master-node-enable-internet.sh.bak
----------+ 1 123 None 3625 ноя 20 15:13 prepare-environment.sh
----------+ 1 123 None 3648 окт 28 14:36 prepare-environment.sh.bak
----------+ 1 123 None 1857 ноя 20 15:13 slave-nodes-create-and-boot.sh
----------+ 1 123 None 1853 сен 23 17:08 slave-nodes-create-and-boot.sh.bak

./functions:
итого 40
d---------+ 1 123 None 0 ноя 20 15:13 .
d---------+ 1 123 None 0 ноя 20 15:13 ..
----------+ 1 123 None 1766 ноя 20 15:13 memory.sh
----------+ 1 123 None 1980 окт 28 14:53 memory.sh.bak
----------+ 1 123 None 5090 ноя 20 15:13 network.sh
----------+ 1 123 None 6677 ноя 20 15:13 product.sh
----------+ 1 123 None 5396 ноя 20 15:13 vm.sh

./iso:
итого 2525613
d---------+ 1 123 None 0 ноя 20 14:22 .
d---------+ 1 123 None 0 ноя 20 15:13 ..
----------+ 1 123 None 2586220544 окт 21 20:06 MirantisOpenStack-5.1.iso
----------+ 1 123 None 23 сен 23 18:08 README.md

123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$ uname -a
CYGWIN_NT-6.1 123-VAIO 1.7.32(0.274/5/3) 2014-08-13 23:06 x86_64 Cygwin

123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$

Operating system is "Windows 7 Домашняя расширенная" (Windows 7 Home Premium, Russian )

Revision history for this message
Serhii Ovsianikov (sovsianikov) wrote :

I see you have problems with files permissions. The + indicates that there is an ACL applied or extended permissions.

Could you please do the following:
1. scripts return to the default state
2. copy MirantisOpenStack-5.1.iso in to iso folder
3. execute following command:
 > cd /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/
 > chmod -R u+rwx *
 > chmod -R a+rx *
4. Run start script ./launch.sh again

Revision history for this message
Julia Varigina (jvarigina) wrote :
Download full text (3.7 KiB)

The result is the same as before:iso image not found

123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$ chmod -R u+rwx *

123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$ chmod -R a+rx *

123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$ ls -aRl
.:
итого 36
d---------+ 1 123 None 0 ноя 20 15:13 .
d---------+ 1 123 None 0 ноя 20 14:28 ..
drwxr-xr-x+ 1 123 None 0 ноя 20 15:13 actions
-rwxr-xr-x+ 1 123 None 6749 сен 23 18:08 config.sh
-rwxr-xr-x+ 1 123 None 7001 окт 28 14:51 config.sh.bak
drwxr-xr-x+ 1 123 None 0 ноя 20 15:13 functions
drwxr-xr-x+ 1 123 None 0 ноя 20 14:22 iso
-rwxr-xr-x+ 1 123 None 1338 сен 23 18:08 launch.sh
-rwxr-xr-x+ 1 123 None 44 сен 23 18:08 launch_16GB.sh
-rwxr-xr-x+ 1 123 None 43 сен 23 18:08 launch_4GB.sh
-rwxr-xr-x+ 1 123 None 43 сен 23 18:08 launch_8GB.sh
-rwxr-xr-x+ 1 123 None 526 сен 23 18:08 README.md

./actions:
итого 56
drwxr-xr-x+ 1 123 None 0 ноя 20 15:13 .
d---------+ 1 123 None 0 ноя 20 15:13 ..
-rwxr-xr-x+ 1 123 None 1083 сен 23 18:08 clean-previous-installation.sh
-rwxr-xr-x+ 1 123 None 1083 сен 23 17:08 clean-previous-installation.sh.bak
-rwxr-xr-x+ 1 123 None 1242 сен 23 18:08 create-interfaces.sh
-rwxr-xr-x+ 1 123 None 1242 сен 23 17:08 create-interfaces.sh.bak
-rwxr-xr-x+ 1 123 None 1794 сен 23 18:08 master-node-create-and-install.sh
-rwxr-xr-x+ 1 123 None 1794 сен 23 17:08 master-node-create-and-install.sh.bak
-rwxr-xr-x+ 1 123 None 1353 сен 23 18:08 master-node-enable-internet.sh
-rwxr-xr-x+ 1 123 None 1353 сен 23 17:08 master-node-enable-internet.sh.bak
-rwxr-xr-x+ 1 123 None 3619 сен 23 18:08 prepare-environment.sh
-rwxr-xr-x+ 1 123 None 3648 окт 28 14:36 prepare-environment.sh.bak
-rwxr-xr-x+ 1 123 None 1853 сен 23 18:08 slave-nodes-create-and-boot.sh
-rwxr-xr-x+ 1 123 None 1853 сен 23 17:08 slave-nodes-create-and-boot.sh.bak

./functions:
итого 40
drwxr-xr-x+ 1 123 None 0 ноя 20 15:13 .
d---------+ 1 123 None 0 ноя 20 15:13 ..
-rwxr-xr-x+ 1 123 None 1766 сен 23 18:08 memory.sh
-rwxr-xr-x+ 1 123 None 1980 окт 28 14:53 memory.sh.bak
-rwxr-xr-x+ 1 123 None 5090 сен 23 18:08 network.sh
-rwxr-xr-x+ 1 123 None 6677 сен 23 18:08 product.sh
-rwxr-xr-x+ 1 123 None 5396 сен 23 18:08 vm.sh

./iso:
итого 2525613
drwxr-xr-x+ 1 123 None 0 ноя 20 14:22 .
d---------+ 1 123 None 0 ноя 20 15:13 ..
-rwxr-xr-x+ 1 123 None 2586220544 окт 21 20:06 MirantisOpenStack-5.1.iso
-rwxr-xr-x+ 1 123 None 23 сен 23 18:08 README.md

123@123-VAIO /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox
$ ./launch.sh
Load properties from file /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/actions/../config//config.properties
sed: невозможно прочитать /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/actions/../config//config.properties: No such file or directory
sed: невозможно прочитать /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/actions/../config//config.properties: No such file or directory
sed: невозможно прочитать /cygdrive/c/FuelISOBugReport/vbox-scripts-5.1/virtualbox/actions/../config//config.properties: No such file or directory
sed: невозможно прочитать /cygdrive/c/...

Read more...

Revision history for this message
Julia Varigina (jvarigina) wrote :

I have found the second workaround:
to add current folder to my PATH variable.

$ export PATH=$PATH:.

$ ./launch.sh
Checking for 'expect'... OK
If you run this script under Cygwin, you may have to add path to VirtualBox directory to your PATH.
Usually it is enough to run "export PATH=$PATH:"/cygdrive/c/Program Files/Oracle/VirtualBox"
Checking for "VBoxManage"... OK
Checking for VirtualBox Extension Pack... OK
Checking for Mirantis OpenStack ISO image... OK
Going to use Mirantis OpenStack ISO file iso/MirantisOpenStack-5.1.iso
Checking if SSH client installed...
OK
Checking if ipconfig or ifconfig installed...
OK
Setup is done.
Found existing VM: fuel-master. Deleting it...
Deleting existing virtual machine fuel-master...
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

But this approach is not recommended because it adds security vulnerability
as discussed here:
http://stackoverflow.com/questions/6331075/why-do-you-need-dot-slash-before-script-name-to-run-it-in-bash

We should be able to reproduce the "iso image not found " issue on Unix as well,
if PATH variable does not contain current folder.

Changed in fuel:
status: Triaged → Incomplete
Revision history for this message
Serhii Ovsianikov (sovsianikov) wrote :

Reinstallation of Cygwin solved the issue.

Changed in fuel:
status: Incomplete → Won't Fix
Revision history for this message
Julia Varigina (jvarigina) wrote :

The issue was caused by the wrong scripts (config.sh) in the PATH.
Steps to reproduce:
1) Create script file С:/WRONG_SCRIPTS/config.sh
This script should output debug message:
echo "*** I'm wrong config.sh ***"
2) Add С:/WRONG_SCRIPTS to your Windows Path variable
3) Start cygwin
4) Verify that cygwin PATH contains folder WRONG_SCRIPTS
echo $PATH
5) Change directory to virtualbox
6) Run ./launch.sh
7) Verify that you see debug output from C:/WRONG_SCRIPTS/config.sh
8) Verify that you get "image is not found" error

Changed in fuel:
status: Won't Fix → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-main (master)

Fix proposed to branch: master
Review: https://review.openstack.org/140293

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-main (master)

Reviewed: https://review.openstack.org/140293
Committed: https://git.openstack.org/cgit/stackforge/fuel-main/commit/?id=fe90cd9a2abba71196b9d6afe29ff8add2985a18
Submitter: Jenkins
Branch: master

commit fe90cd9a2abba71196b9d6afe29ff8add2985a18
Author: Serhiy Ovsianikov <email address hidden>
Date: Tue Dec 9 12:38:21 2014 +0200

    Fixed search Fuel ISO in vbox scripts

    Fixed relative paths when are invoked other vbox scripts.
    If we have another config.sh which is located on a different path
    in the variable PATH, we have an error.

    Change-Id: I1dfadebac4f76d18f85ca396a202d3550948042d
    Closes-Bug: #1393557

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-main (stable/6.0)

Fix proposed to branch: stable/6.0
Review: https://review.openstack.org/141536

Mike Scherbakov (mihgen)
Changed in fuel:
milestone: 6.0 → 6.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-main (stable/6.0)

Reviewed: https://review.openstack.org/141536
Committed: https://git.openstack.org/cgit/stackforge/fuel-main/commit/?id=f7defb6ad67e0ff126602e8e3374c0d6c211fd4e
Submitter: Jenkins
Branch: stable/6.0

commit f7defb6ad67e0ff126602e8e3374c0d6c211fd4e
Author: Serhiy Ovsianikov <email address hidden>
Date: Tue Dec 9 12:38:21 2014 +0200

    Fixed search Fuel ISO in vbox scripts

    Fixed relative paths when are invoked other vbox scripts.
    If we have another config.sh which is located on a different path
    in the variable PATH, we have an error.

    Change-Id: I1dfadebac4f76d18f85ca396a202d3550948042d
    Closes-Bug: #1393557

tags: added: system-test-not-required
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.