Dominator icon indicating copy to clipboard operation
Dominator copied to clipboard

imaginator "expected integer" error while building the bootstrap image

Open masiulaniec opened this issue 6 years ago • 1 comments

# cat /var/log/imaginator/2018-05-21:15:16:13.994
2018/05/21 15:16:14 Building new image for stream: bootstrap/Debian-9
2018/05/21 15:21:30 Error building image: bootstrap/Debian-9: expected integer
# 

The following patch works around it:

diff -purN imagebuilder/builder/bootstrapImage.go imagebuilder/builder/bootstrapImage.go
--- imagebuilder/builder/bootstrapImage.go	2018-05-21 15:50:22.388786285 +0000
+++ imagebuilder/builder/bootstrapImage.go	2018-05-21 15:50:59.807545192 +0000
@@ -117,8 +117,8 @@ func (packager *packagerType) writePacka
 func (packager *packagerType) writePackageInstallerContents(writer io.Writer) {
 	fmt.Fprintln(writer, "#! /bin/sh")
 	fmt.Fprintln(writer, "# Created by imaginator.")
-	fmt.Fprintln(writer, "mount -n none -t proc /proc")
-	fmt.Fprintln(writer, "mount -n none -t sysfs /sys")
+	fmt.Fprintln(writer, "mount -n none -t proc /proc 2>/dev/null")
+	fmt.Fprintln(writer, "mount -n none -t sysfs /sys 2>/dev/null")
 	for _, line := range packager.Verbatim {
 		fmt.Fprintln(writer, line)
 	}

The error is due to fmt.Fscanf in (*bootstrapStream).build:

	output := new(bytes.Buffer)
	err := runInTarget(nil, output, rootDir, packagerPathname,
		"show-size-multiplier")
	if err != nil {
		return nil, err
	}
	sizeMultiplier := uint64(1)
	nScanned, err := fmt.Fscanf(output, "%d", &sizeMultiplier)

... trying to parse the following error from mount as an integer:

mount: none is already mounted or /sys busy
       none is already mounted on /proc
       none is already mounted on /sys
       none is already mounted on /proc

masiulaniec avatar May 21 '18 16:05 masiulaniec

Can you please debug some more? Why are file-systems already mounted in this fresh chroot mount namespace? What happens if you put mount --make-rprivate / before the other calls to mount?

rgooch avatar May 22 '18 05:05 rgooch