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

debootstrap.log doesn't exist on failure #524

Closed
voltagex opened this issue Jun 17, 2021 · 12 comments
Closed

debootstrap.log doesn't exist on failure #524

voltagex opened this issue Jun 17, 2021 · 12 comments

Comments

@voltagex
Copy link

voltagex commented Jun 17, 2021

See https://builds.sr.ht/~voltagex/job/527248, specifically

W: Failure trying to run: chroot "/home/build/pi-gen/work/2021-06-17-test/stage0/rootfs" /bin/true
W: See /home/build/pi-gen/work/2021-06-17-test/stage0/rootfs/debootstrap/debootstrap.log for details
rmdir: failed to remove '/home/build/pi-gen/work/2021-06-17-test/stage0/rootfs/debootstrap': Directory not empty
build@build:~/pi-gen$ less /home/build/pi-gen/work/2021-06-17-test/stage0/rootfs/build.log
/home/build/pi-gen/work/2021-06-17-test/stage0/rootfs/build.log: No such file or directory

rmdir "$2/debootstrap"
doesn't seem like it should remove the file itself so I'm not sure what's going on.

@voltagex voltagex changed the title debootstrap.log is removed on failure debootstrap.log doesn't exist on failure Jun 17, 2021
@voltagex
Copy link
Author

It's this, but I don't know why.
#338

@voltagex voltagex reopened this Jun 17, 2021
@XECDesign
Copy link
Member

It means debootstrap failed, so I'd check the log file it generates.

@XECDesign
Copy link
Member

Sorry, missed the part where you mentioned the log file already.

I don't see pi-gen removing the log file. It tries to remove the directory and fails if it's not empty, which is the intended behaviour. On succesfull bootstrap, that directory should be empty.

Without being able to reproduce the issue myself, I can't really help.

@voltagex
Copy link
Author

voltagex commented Jun 21, 2021

Right, the build system was unmounting things before I could check what was going on.

The underlying error appears to be

build@build:~$ sudo chroot "/home/build/pi-gen/work/2021-06-21-test/stage0/rootfs" /bin/true
chroot: failed to run command '/bin/true': Exec format error

(the same error is in /home/build/pi-gen/work/2021-06-21-test/stage0/rootfs/debootstrap/debootstrap.log)

Which I thought was handled by binfmt_misc and qemu-static.

The reason I couldn't find the log is that the qcow2 filesystem is unmounted on error.

@voltagex
Copy link
Author

Sorry, I'd missed the binfmt-support package requirement. I still think there's a potential bug with the debootstrap.log being "hidden" in the now-unmounted filesystem.

@XECDesign
Copy link
Member

What do you think would be an intuitive way to cope with that?

I didn't originally include qcow2 support was because it adds an extra layer of things that can go wrong and makes troubleshooting more difficult. Should the default be to not use qcow? Should pi-gen 'tail' the output of debootstrap.log if it's present?

@voltagex
Copy link
Author

@XECDesign IMO qcow2 is the right thing to use, what about grabbing debootstrap.log and copying it out of the work path before unmounting?

@XECDesign
Copy link
Member

Something along these lines?

f9d44ed

@voltagex
Copy link
Author

voltagex commented Jul 3, 2021

Thank you!

@voltagex voltagex closed this as completed Jul 3, 2021
@nullromo
Copy link

nullromo commented Jul 25, 2024

I'm having the same error

chroot: failed to run command ‘/bin/true’: Exec format error

showing up in debootstrap.log. I don't understand what this means. @voltagex any info on how you solved this? And you're right; it looks the same as #338.

I could open a new issue if that's better.

@voltagex
Copy link
Author

@nullromo no, this was 3 years ago. Exec format error means that the binary is the wrong type for your machine, i.e. arm binary trying to run on an x86_64 system.

@nullromo
Copy link

Thanks. I think I got confused about something, and I was running the wrong version of my code for a while there. I opened a new issue instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants