Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. Backup failing with "copy code: 1, signal: null": "cannot create hard link" "operation not permitted"

Backup failing with "copy code: 1, signal: null": "cannot create hard link" "operation not permitted"

Scheduled Pinned Locked Moved Solved Support
backups
26 Posts 3 Posters 811 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • girishG girish

      What I found so far is that the link operation is denied by the kernel. dmesg has the following lines:

      [563683.439933] audit: type=1702 audit(1601496162.706:33): op=linkat ppid=5039 pid=10646 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 tty=(none) ses=4294967295 comm="cp" exe="/bin/cp" res=0
      [563683.439938] audit: type=1302 audit(1601496162.706:34): item=0 name="/path/dovecot-uidlist.lock" inode=2246683 dev=fc:20 mode=0100644 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0
      

      The type= means this from audit.h

      1702 /* Suspicious use of file links */
      1302    /* Filename path information */
      

      And according to https://access.redhat.com/articles/4409591 it's triggering for some ANOM_LINK event type. So far, there is little to no information on what all this means.

      robiR Offline
      robiR Offline
      robi
      wrote on last edited by
      #21

      @girish this sounds to me like a resource or policy type exhaustion issue. Like when ulimit it too low or we run out of inodes.

      Is anything else running in the kernel, like SE Linux?

      Are we hitting limits on hardlinks with large enough backups? I believe the limit on ext4 is 65k

      It would be interesting to switch filesystems and see if it happens on xfs for example.

      Do you have an Object Store target option via S3?

      Conscious tech

      1 Reply Last reply
      0
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #22

        I think the 65k is the number of hardlinks on a file and not the hardlinks on a file system.

        The rabbit hole goes as deep as we want to πŸ™‚

        I think I found the problem though of course I have to try it out. audit_log_path_denied here - https://elixir.bootlin.com/linux/latest/source/fs/namei.c#L955 is where the audit log is raised. I am no kernel expert but a casual reading of the comment "Allowed if owner and follower match" suggests that the owner of file and the linker is not matching. The symlinking process runs as user yellowtent.

        root@my:/cloudron-backups/snapshot/box/mail# find . -user root -type f
        ./blah/blah/dovecot-uidlist.lock
        ./blah/blah/1600972556.M892349P24001.69d0c668883d,S=6124,W=6234:2,S
        

        Bingo! For some reason, these 2 specific files are not owner yellowtent and are root. Looks like some bug/race in the code that creates snapshot. Curiously, both the files above are of 0 size, so maybe that's causing some strange event ordering.

        1 Reply Last reply
        1
        • girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #23

          Yay, found the problem πŸ™‚ Issue is that if a file disappears when we are creating the snapshot, the code errors. Usually files in the snapshot are chowned to the yellowtent user but on an error it ends up creating an empty file in the snapshot directory with the root permission. The hard linking code is run as yellowtent user, and thus symlinking fails. Phew!

          1 Reply Last reply
          2
          • robiR Offline
            robiR Offline
            robi
            wrote on last edited by
            #24

            Yaay! .. and there was much rejoicing! πŸ˜‰

            Nicely done.

            That root owned file would be concerning as a local root escalation. What else there runs as root while yellowtent is doing it's thing?

            Conscious tech

            1 Reply Last reply
            0
            • girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by
              #25

              Fixed with https://git.cloudron.io/cloudron/box/-/issues/741

              d19dotcaD 1 Reply Last reply
              1
              • girishG girish

                Fixed with https://git.cloudron.io/cloudron/box/-/issues/741

                d19dotcaD Offline
                d19dotcaD Offline
                d19dotca
                wrote on last edited by
                #26

                @girish that’s perfect, great detective work! Thanks Girish for working to solve that. I really appreciate it. I’ll keep an eye on it in my server you patched and see if the issue comes back. Thanks again! πŸ™‚

                --
                Dustin Dauncey
                www.d19.ca

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Bookmarks
                  • Search