Pipeline build that needs to use chroot
Asked by Matt Schuckmann:

I've got a Pipeline build that requires running chroot to create a boot image and it appears to be failing because of some permissions thing.

I believe I read some where that chroot is not allowed in pipelines but I'm not sure where, can anyone point me to this documentation? And if it is true that chroot can't be run in a pipeline what is the recommended workaround to get my pipeline working?


Answers:
author: Patrik S
body: Hello [@Matt Schuckmann](/t5/user/viewprofilepage/user-id/4502929) ,

I did some testing on my personal repository and was able to chroot in a directory inside the pipelines cloning dir.

That said, would you please share us the error that you are receiving when doing *chroot* on your pipeline ? What is the exact command you are executing ?

It would also help if you could share us the *bitbucket-pipelines.yml* file you have setup, so we can better understand the steps you are executing on your build. Please make sure to sanitize any personal information/credentials while copying the content of the file here.

Let us know in case you have any questions.

Thanks, [@Matt Schuckmann](/t5/user/viewprofilepage/user-id/4502929) .

Kind regards,

Patrik S

comments: author: Matt Schuckmann
body: Hello [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)

Thanks for responding, I'll get on creating a more concise example for you to investigate.

In the mean time I had found [this thread](https://community.atlassian.com/t5/Bitbucket-questions/How-to-chroot-in-the-Pipelines/qaq-p/1566024) that suggests that using chroot in a pipeline is not allowed:

Did I miss understand the response in that thread?

Also here is the error I'm seeing with a pipeline build that uses the Debian Live-build tool to create a live image ISO (I know this snippet is probably not enough for you to debug the issue so I'll work on creating something more detailed).

<br />

```
I: Base system installed successfully.

[2022-01-21 02:22:12] lb bootstrap_cache save

P: Saving bootstrap stage to cache...

[2022-01-21 02:22:13] lb chroot_prep install all-except-archives

[2022-01-21 02:22:13] lb chroot_devpts install

P: Begin mounting /dev/pts...

mount: /opt/atlassian/pipelines/agent/build/live/chroot/dev/pts: permission denied.

[2022-01-21 02:22:13] lb chroot_proc install

P: Begin mounting /proc...

mount: /opt/atlassian/pipelines/agent/build/live/chroot/proc: permission denied.

E: An unexpected failure occurred, exiting...

P: Begin unmounting filesystems...

P: Saving caches...

 
```

<br />

I already know that this build works from our docker image when run on our development systems, the only difference seems to be that it fails when run as part of a BB pipeline.

Matt S.


author: Patrik S
body: Hello [@Matt Schuckmann](/t5/user/viewprofilepage/user-id/4502929) ,

In order to better assist you, I went ahead and created an internal support ticket for this particular case, with the e-mail you have associated with your community account.

With an support ticket, I will be able to access the builds and logs from our side, which will allow for faster and better troubleshooting for this issue.

You should have received an e-mail with the link of the ticket, but in case you was not able to find it, please let me know, so I can send it here. The support ticket will be visible only to you and Atlassian staff.

Thanks [@Matt Schuckmann](/t5/user/viewprofilepage/user-id/4502929)

Kind regards,

Patrik S


Tags: bitbucket-cloud

bitbucket-pipelines

cloud