https://www.puppet.com/community logo
Join Slack
Powered by
# bolt
  • y

    Yury Bushmelev

    05/08/2025, 8:01 AM
    I’d blame some OS misconfiguration (or hardening).. saw some issues on noexec-mounted /tmp or /home e.g.
  • c

    Christian Michael Tan

    05/08/2025, 8:18 AM
    What version of Bolt are you using?
  • y

    Yury Bushmelev

    05/08/2025, 8:21 AM
    4.0.0 on MacOS 15
  • y

    Yury Bushmelev

    05/08/2025, 8:21 AM
    though usually I’m using the same version on Debian 12 (my office desktop)
  • c

    Christian Michael Tan

    05/08/2025, 8:24 AM
    Okay that might have something to do it, as i'm using version 3.30
  • c

    Christian Michael Tan

    05/08/2025, 8:27 AM
    Nevermind, I just updated to 4.0.0 and still having the same errors. I did check the mounting on /tmp and /home, mine doesnt have noexec
  • c

    Christian Michael Tan

    05/08/2025, 8:27 AM
    But really appreciate you checking, thank you!
  • y

    Yury Bushmelev

    05/08/2025, 8:36 AM
    now I’m curious what might be the problem there
  • y

    Yury Bushmelev

    05/08/2025, 8:37 AM
    could you check if any other task runs? e.g.
    bolt task run package -t <VM> name=bash action=status
  • c

    Christian Michael Tan

    05/08/2025, 8:42 AM
    Here's the output
    {
    "status": "installed",
    "version": "5.2.21-2ubuntu4"
    }
  • y

    Yury Bushmelev

    05/08/2025, 8:46 AM
    so task executor is good
  • y

    Yury Bushmelev

    05/08/2025, 8:58 AM
    @Christian Michael Tan try
    bolt apply
    with
    --log-level=trace
    , it’ll dump more debug info
  • c

    Christian Michael Tan

    05/08/2025, 9:01 AM
    Sure let me try. The previous logs I sent was run using log-level debug
  • y

    Yury Bushmelev

    05/08/2025, 9:03 AM
    it seems you have tmpdir settings changed to
    /home/<user>
    , because all files I see are uploaded to
    /tmp
    subdir
  • c

    Christian Michael Tan

    05/08/2025, 9:04 AM
    Yes correct, will the setting impact the bolt apply run? (other than the dependency files wont get deleted after VM reboot)
  • y

    Yury Bushmelev

    05/08/2025, 9:05 AM
    ideally no, just found that from the output
  • c

    Christian Michael Tan

    05/08/2025, 9:06 AM
    Okay it turns out custom_facts.rb is getting successfully uploaded `Command
    mkdir -m 700 /home/pgadmin/ce65b898-868b-46d6-9bed-1c1fa95bb78f
    returned successfully`
    Uploading /opt/puppetlabs/bolt/lib/ruby/gems/3.2.0/gems/bolt-4.0.0/libexec/custom_facts.rb to /home/pgadmin/ce65b898-868b-46d6-9bed-1c1fa95bb78f/custom_facts.rb
    `Executing `chmod u+x /home/pgadmin/ce65b898-868b-46d6-9bed-1c1fa95bb78f/custom_facts.rb`` `Command
    chmod u+x /home/pgadmin/ce65b898-868b-46d6-9bed-1c1fa95bb78f/custom_facts.rb
    returned successfully` `Executing `id -g root`` `Command
    id -g root
    returned successfully`
  • c

    Christian Michael Tan

    05/08/2025, 9:08 AM
    I am having this odd log: `Executing `sudo -S -H -u root -p \[sudo\]\ Bolt\ needs\ to\ run\ as\ another\ user,\ password:\ sh -c cd\;\ chown\ -R\ root:0\ /home/pgadmin/ce65b898-868b-46d6-9bed-1c1fa95bb78f`` `Command
    sudo -S -H -u root -p \[sudo\]\ Bolt\ needs\ to\ run\ as\ another\ user,\ password:\  sh -c cd\;\ chown\ -R\ root:0\ /home/pgadmin/ce65b898-868b-46d6-9bed-1c1fa95bb78f
    returned successfully` `Executing `sudo -S -H -u root -p \[sudo\]\ Bolt\ needs\ to\ run\ as\ another\ user,\ password:\ sh -c echo\ d7e93e12-01e1-4aa1-ae73-b0838511c745\ 1\>\&2\;\ cd\;\ /home/pgadmin/ce65b898-868b-46d6-9bed-1c1fa95bb78f/custom_facts.rb``
    Command sudo -S -H -u root -p \[sudo\]\ Bolt\ needs\ to\ run\ as\ another\ user,\ password:\  sh -c echo\ d7e93e12-01e1-4aa1-ae73-b0838511c745\ 1\>\&2\;\ cd\;\ /home/pgadmin/ce65b898-868b-46d6-9bed-1c1fa95bb78f/custom_facts.rb failed with exit code 127
    `Executing `sudo -S -H -u root -p \[sudo\]\ Bolt\ needs\ to\ run\ as\ another\ user,\ password:\ sh -c cd\;\ rm\ -rf\ /home/pgadmin/ce65b898-868b-46d6-9bed-1c1fa95bb78f`` `Command
    sudo -S -H -u root -p \[sudo\]\ Bolt\ needs\ to\ run\ as\ another\ user,\ password:\  sh -c cd\;\ rm\ -rf\ /home/pgadmin/ce65b898-868b-46d6-9bed-1c1fa95bb78f
    returned successfully`
    Closed session
  • y

    Yury Bushmelev

    05/08/2025, 9:09 AM
    Copy code
    Executing `sudo -S -H -u root -p \[sudo\]\ Bolt\ needs\ to\ run\ as\ another\ user,\ password:\  sh -c echo\ c4c82093-aa24-4f76-b073-b62d06de2360\ 1\>\&2\;\ cd\;\ /tmp/8536a2b4-f062-4c1a-a51e-b5585b378a0f/apply_catalog.rb`
    Command `sudo -S -H -u root -p \[sudo\]\ Bolt\ needs\ to\ run\ as\ another\ user,\ password:\  sh -c echo\ c4c82093-aa24-4f76-b073-b62d06de2360\ 1\>\&2\;\ cd\;\ /tmp/8536a2b4-f062-4c1a-a51e-b5585b378a0f/apply_catalog.rb` returned successfully
  • y

    Yury Bushmelev

    05/08/2025, 9:09 AM
    this how it looks on my side
  • y

    Yury Bushmelev

    05/08/2025, 9:10 AM
    there was a way to prevent cleanup.. let me find it
  • y

    Yury Bushmelev

    05/08/2025, 9:11 AM
    Copy code
    config:
      ssh:
        cleanup: false
  • y

    Yury Bushmelev

    05/08/2025, 9:12 AM
    https://www.puppet.com/docs/bolt/latest/bolt_transports_reference#cleanup-5
  • c

    Christian Michael Tan

    05/08/2025, 9:23 AM
    Its saying that its not able to find the custom_facts.rb file
    Skipping cleanup of tmpdir /home/pgadmin/2c409c8d-74ac-4997-a5ab-e30e7752f44b [ID: skip_cleanup]
    Closed session
    {"target":"10.121.140.11","action":"task","object":"apply_helpers::custom_facts","status":"failure","value":{"_output":"","_error":{"kind":"puppetlabs.tasks/task-error","issue_code":"TASK_ERROR","msg":"The task failed with exit code 127 and no stdout, but stderr contained:\nsh: 1: /home/pgadmin/2c409c8d-74ac-4997-a5ab-e30e7752f44b/custom_facts.rb: not found\n","details":{"exit_code":127}}}}
    But it definitely exists in the VM
  • y

    Yury Bushmelev

    05/08/2025, 9:26 AM
    what is shebang in the file? check 1st line there
  • y

    Yury Bushmelev

    05/08/2025, 9:26 AM
    for me it’s
    #! /opt/puppetlabs/puppet/bin/ruby
  • y

    Yury Bushmelev

    05/08/2025, 9:27 AM
    so check if the file exists in your VM and it’s executable
  • y

    Yury Bushmelev

    05/08/2025, 9:27 AM
    Copy code
    root@lima-limapark-ubuntu2404:~# /opt/puppetlabs/puppet/bin/ruby --version
    ruby 3.2.5 (2024-07-26 revision 31d0f1a2e7) [aarch64-linux]
  • y

    Yury Bushmelev

    05/08/2025, 9:28 AM
    also you can try to run the custom_facts.rb manually as root.. it should break but you’ll see how exactly at least
  • c

    Christian Michael Tan

    05/08/2025, 10:14 AM
    Let me look into this deeper