archlinuxcn / lilac

Lilac is the build bot for archlinuxcn
GNU General Public License v3.0
113 stars 39 forks source link

Exit find comannd with non-zero code #195

Closed Hayao0819 closed 12 months ago

Hayao0819 commented 1 year ago

I have been building new lilac server, reading English document.

When I run lilac command, the prompt returned and lilac leaved the error log.

:: Synchronizing package databases...
 archlinuxcn downloading...
 core downloading...
 extra downloading...
 community downloading...
[D 01-05 02:40:12.360 cmd:88] running ['git', 'reset', '--hard'], not using pty, showing output
HEAD is now at d9ec454 Remove: Old readme
[D 01-05 02:40:12.444 cmd:88] running ['git', 'pull', '--no-edit'], not using pty, showing output
Already up to date.
[I 01-05 02:40:14.812 nvchecker:121] Running nvchecker...
[W 01-05 02:40:15.183 nvchecker:180] send nvchecker report for {'alterlinux-i3-manager', 'dummy', 'alterlinux-fcitx-conf', 'alterlinux-keyring', 'fascode-live-tools', 'archlinux32-keyring', 'filesystem'} packages to hayao <hayao@fascode.net>
[D 01-05 02:40:15.184 cmd:88] running ['git', 'diff', '--name-only', '--relative', '4b825dc642cb6eb9a060e54bf8d69288fbee4904', 'HEAD'], not using pty, showing output
alterlinux-fcitx-conf/.SRCINFO
alterlinux-fcitx-conf/PKGBUILD
alterlinux-fcitx-conf/lilac.yaml
alterlinux-i3-manager/.SRCINFO
alterlinux-i3-manager/PKGBUILD
alterlinux-i3-manager/lilac.yaml
alterlinux-keyring/.SRCINFO
alterlinux-keyring/PKGBUILD
alterlinux-keyring/alterlinux-keyring.install
alterlinux-keyring/lilac.yaml
alterlinux-mirrorlist/.SRCINFO
alterlinux-mirrorlist/.gitignore
alterlinux-mirrorlist/PKGBUILD
alterlinux-mirrorlist/alterlinux-mirrorlist-update
alterlinux-mirrorlist/alterlinux-mirrorlist.service
alterlinux-mirrorlist/mirrorlist-alter
archlinux32-keyring/.SRCINFO
archlinux32-keyring/PKGBUILD
archlinux32-keyring/archlinux32-keyring.install
archlinux32-keyring/lilac.yaml
dummy/.SRCINFO
dummy/PKGBUILD
dummy/lilac.yaml
fascode-live-tools/.SRCINFO
fascode-live-tools/.gitignore
fascode-live-tools/PKGBUILD
fascode-live-tools/lilac.yaml
filesystem/.SRCINFO
filesystem/PKGBUILD
filesystem/archlinux-logo.png
filesystem/archlinux-logo.svg
filesystem/archlinux.png
filesystem/archlinux.svg
filesystem/crypttab
filesystem/env-generator
filesystem/fstab
filesystem/group
filesystem/gshadow
filesystem/host.conf
filesystem/hosts
filesystem/issue
filesystem/ld.so.conf
filesystem/letter-to-you
filesystem/lilac.yaml
filesystem/locale.sh
filesystem/motd
filesystem/nsswitch.conf
filesystem/os-release
filesystem/passwd
filesystem/profile
filesystem/resolv.conf
filesystem/securetty
filesystem/shadow
filesystem/shells
filesystem/sysctl
filesystem/sysusers
filesystem/tmpfiles
[D 01-05 02:40:15.198 cmd:88] running ['git', 'diff', '-p', '4b825dc642cb6eb9a060e54bf8d69288fbee4904', 'HEAD', '--', 'alterlinux-i3-manager/PKGBUILD'], not using pty, not showing output
[D 01-05 02:40:15.211 cmd:88] running ['git', 'diff', '-p', '4b825dc642cb6eb9a060e54bf8d69288fbee4904', 'HEAD', '--', 'dummy/PKGBUILD'], not using pty, not showing output
[D 01-05 02:40:15.218 cmd:88] running ['git', 'diff', '-p', '4b825dc642cb6eb9a060e54bf8d69288fbee4904', 'HEAD', '--', 'alterlinux-fcitx-conf/PKGBUILD'], not using pty, not showing output
[D 01-05 02:40:15.223 cmd:88] running ['git', 'diff', '-p', '4b825dc642cb6eb9a060e54bf8d69288fbee4904', 'HEAD', '--', 'alterlinux-keyring/PKGBUILD'], not using pty, not showing output
[D 01-05 02:40:15.229 cmd:88] running ['git', 'diff', '-p', '4b825dc642cb6eb9a060e54bf8d69288fbee4904', 'HEAD', '--', 'fascode-live-tools/PKGBUILD'], not using pty, not showing output
[D 01-05 02:40:15.242 cmd:88] running ['git', 'diff', '-p', '4b825dc642cb6eb9a060e54bf8d69288fbee4904', 'HEAD', '--', 'archlinux32-keyring/PKGBUILD'], not using pty, not showing output
[D 01-05 02:40:15.250 cmd:88] running ['git', 'diff', '-p', '4b825dc642cb6eb9a060e54bf8d69288fbee4904', 'HEAD', '--', 'filesystem/PKGBUILD'], not using pty, not showing output
[D 01-05 02:40:15.261 cmd:88] running ['git', 'log', '-1', '--format=%H'], not using pty, showing output
d9ec4542acc8e6e99f2975a35c436d1dc3c5773f
[D 01-05 02:40:15.270 cmd:88] running ['git', 'reset', '--hard'], not using pty, showing output
HEAD is now at d9ec454 Remove: Old readme
find: '/tmp/shitty-bazel': No such file or directory
[E 01-05 02:40:15.305 lilac:653] unexpected error
    Traceback (most recent call last):
      File "/usr/bin/lilac", line 650, in main
        main_may_raise(D, pkgs_from_args, logdir)
      File "/usr/bin/lilac", line 644, in main_may_raise
        subprocess.check_call(cmd)
      File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['find', '/tmp/shitty-bazel', '-type', 'd', '-exec', 'chmod', 'u+w', '{}', '+']' returned non-zero exit status 1.

My pkgbuild is following repository.

https://github.com/Hayao0819/alterlinux-repo

I am running lilac on Arch Linux. Can someone tell me the way to fix the error?

lilydjwg commented 1 year ago

Do you have

[bindmounts]
"/tmp/shitty-bazel" = "/build/.cache/bazel"

in your lilac's config? If not, you don't need those postrun commands.

lilydjwg commented 1 year ago

I've got a better way to exclude caches. See latest config.toml.sample.

Please ignore. It doesn't work.

Hayao0819 commented 1 year ago

I already have bindmounts codes.

My config file is copied from /usr/share/doc/lilac/config.toml.sample and I made a few changes.

lilydjwg commented 1 year ago

Weird. What if you remove that "/tmp/shitty-bazel" line and the two postrun commands? (They are only relevant if you have packages using bazel.)

Hayao0819 commented 1 year ago

Umm... I do not have packages which uses bazel.

I rebooted by arch to remove my tmpfs(I checked that there is no such directory)

And, I have no package which has postrun section in lilac.yaml (If yor postrun means another place, please tell me the path)

Hayao0819 commented 1 year ago

I am going to run lilac on other machine (which has Manjaro) tomorrow.

There may be a possible that something on my arch is wrong.

lilydjwg commented 1 year ago

I mean ~/.lilac/config.toml. You can remove all those bazel related config lines if you don't use bazel.

Hayao0819 commented 1 year ago

Ok, I commnted out the line and there seems not to be the error.

But no package is in my directory, what is wrong?

image
lilydjwg commented 1 year ago

It didn't build any packages, presumably because it didn't find any updates (and wasn't configure to retry unchanged failed packages).

To trigger a rebuild, you can add / update the update_on section in lilac.yaml:

update_on:
# other entries
- source: manual
  manual: 1
Hayao0819 commented 1 year ago

Thank you, I added it and works.

But my all package builds failed with following error.

Sorry for asking many times, there is no information about lilac errors.

dummy package has nothing and is the simplest PKGBUILD.

[D 01-07 17:26:42.830 worker:209] got input: {'depend_packages': [], 'update_info': [[None, '1']], 'bindmounts': ['/home/lilac/.cargo:/build/.cargo', '/home/lilac/.cache/pip:/build/.cache/pip', '/home/lilac/.cache/archbuild-bind-cache/stack:/build/.stack', '/home/lilac/.cache/archbuild-bind-cache:/build/.cache'], 'logfile': '/home/lilac/.lilac/log/2023-01-07T17:26:24/dummy.log', 'worker_no': 0, 'result': '/tmp/dummy-233agc2m.lilac'}
[D 01-07 17:26:42.841 cmd:88] running ['sh', '-c', 'rm -f -- *.pkg.tar.xz *.pkg.tar.xz.sig *.pkg.tar.zst *.pkg.tar.zst.sig'], not using pty, showing output
[D 01-07 17:26:42.860 cmd:88] running ['recv_gpg_keys'], not using pty, showing output
[D 01-07 17:26:42.947 cmd:88] running ['bwrap', '--unshare-all', '--ro-bind', '/', '/', '--tmpfs', '/home', '--tmpfs', '/run', '--die-with-parent', '--tmpfs', '/tmp', '--proc', '/proc', '--dev', '/dev', '--share-net', '--bind', '/home/lilac/alterlinux-repo/alter-stable/dummy', '/tmp/dummy', '--chdir', '/tmp/dummy', '--ro-bind', PosixPath('/home/lilac/.lilac/gnupg'), '/home/lilac/.gnupg', 'makepkg', '-od', '--noprepare', '-A'], using pty, showing output
[D 01-07 17:26:42.947 cmd:95] pty master fd=3, slave fd=4.

[2023-01-07 17:26:43 +0900] build (version None) finished in 1s with result: <BuildResult.failed: FileNotFoundError(2, 'No such file or directory'); rusage=None>
lilydjwg commented 1 year ago

Check /home/lilac/.lilac/log/2023-01-07T17:26:24/dummy.log.

Hayao0819 commented 1 year ago

The log I have commented is the path which you said

lilydjwg commented 1 year ago

Oh I see. What's in the lilac-main.log file?

Hayao0819 commented 1 year ago

I paste a part of log about dummy package from lilac-main.log

[D 01-07 17:26:42.061 lilac:210] ready-to-build packages: ['dummy', 'alterlinux-i3-manager', 'filesystem']
[I 01-07 17:26:42.061 lilac:332] building dummy
[I 01-07 17:26:42.062 building:135] depends: set(), resolved: []
[D 01-07 17:26:42.062 building:191] worker input: b'{"depend_packages": [], "update_info": [[null, "1"]], "bindmounts": ["/home/lilac/.cargo:/build/.cargo", "/home/lilac/.cache/pip:/build/.cache/pip", "/home/lilac/.cache/archbuild-bind-cache/stack:/build/.stack", "/home/lilac/.cache/archbuild-bind-cache:/build/.cache"], "logfile": "/home/lilac/.lilac/log/2023-01-07T17:26:24/dummy.log", "worker_no": 0, "result": "/tmp/dummy-233agc2m.lilac"}'
[D 01-07 17:26:42.063 systemd:52] running systemd-run --pipe --quiet --user --wait --remain-after-exit -u lilac-worker-0 -p CPUWeight=100 --working-directory=/home/lilac/alterlinux-repo/alter-stable/dummy --setenv=PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl --setenv=MAKEFLAGS=-j4 "--setenv=PACKAGER=lilac (on behalf of hayao) <hayao@fascode.net>" -- /usr/bin/python -u -m lilac2.worker dummy
[D 01-07 17:26:42.092 systemd:108] lilac-worker-0.service state: dead, waiting
[D 01-07 17:26:43.213 systemd:144] stopping worker service
[E 01-07 17:26:43.285 building:105] build failed with exception
    Traceback (most recent call last):
      File "/usr/lib/python3.10/site-packages/lilac2/building.py", line 68, in build_package
        pkg_version, rusage, error = call_worker(
      File "/usr/lib/python3.10/site-packages/lilac2/building.py", line 199, in call_worker
        rusage, timedout = _call_cmd(
      File "/usr/lib/python3.10/site-packages/lilac2/building.py", line 306, in _call_cmd_systemd
        return systemd.poll_rusage(name, deadline)
      File "/usr/lib/python3.10/site-packages/lilac2/systemd.py", line 121, in poll_rusage
        with open(mem_file) as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/sys/fs/cgroup/user.slice/user-1001.slice/user@1001.service/app.slice/lilac-worker-0.service/memory.current'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/lib/python3.10/site-packages/lilac2/building.py", line 81, in build_package
        may_need_cleanup()
      File "/usr/lib/python3.10/site-packages/lilac2/building.py", line 140, in may_need_cleanup
        st = os.statvfs('/var/lib/archbuild')
    FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/archbuild'
[I 01-07 17:26:43.286 lilac:352] package dummy (version None) finished in 1s with result: <BuildResult.failed: FileNotFoundError(2, 'No such file or directory'); rusage=None>
[E 01-07 17:26:43.286 lilac:388] dummy 1 [None] failed after 1s
[D 01-07 17:26:43.287 repo:318] mail to ['hayao <hayao@fascode.net>']:
    subject: 在打包软件包 dummy 时发生未知错误
    body: 发生未知错误!调用栈如下:

    Traceback (most recent call last):
      File "/usr/lib/python3.10/site-packages/lilac2/building.py", line 68, in build_package
        pkg_version, rusage, error = call_worker(
      File "/usr/li
[D 01-07 17:26:43.288 lilac:210] ready-to-build packages: ['alterlinux-i3-manager', 'filesystem']
lilydjwg commented 1 year ago

No /var/lib/archbuild? The cgroup path doesn't exist. Where has it gone?

Could you run systemd-run --user --wait -u test sleep 10 and see what systemctl --user show test -p ControlGroup prints during its run?

lilydjwg commented 1 year ago

And what if you run extra-x86_64-build in your dummy PKGBUILD directory? Does it work?

Hayao0819 commented 1 year ago

I feel sorry for being late for reply.

Self running extra-x86_64-build builds package file and exits with 0 code and so in other package.

lilydjwg commented 1 year ago

Could you check if /var/lib/archbuild exists and https://github.com/archlinuxcn/lilac/issues/195#issuecomment-1374869389?

Hayao0819 commented 1 year ago

There is /var/lib/archbuild/extra-x86_64.

Hayao0819 commented 1 year ago

And the result of the command is

ControlGroup=/user.slice/user-1001.slice/user@1001.service/app.slice/test.service
lilydjwg commented 1 year ago

Hmmm, that's quite normal. Why is lilac seeing different...

Hayao0819 commented 1 year ago

I will try it on different machine which has manjaro.

If it goes well, something on my arch is wrong.

Hayao0819 commented 1 year ago

I found that my lilac user has no gpg key and I have made it.

And then I re-run lilac command but no packages are triggred.

My destdir is still empty and rebuild_failed_pkgs is set to true.

lilydjwg commented 1 year ago

Can you share lilac-main.log for this run?