https://www.puppet.com/community logo
Join Slack
Powered by
# bolt
  • 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
  • j

    Johan Basson

    05/19/2025, 3:33 PM
    Hi team, I'm trying to speed up a bolt run and would like some assistance. I have a plan where I execute a run command and then want to run tasks based on the results, more details in thread
    y
    • 2
    • 9
  • c

    Christian Michael Tan

    06/04/2025, 7:52 AM
    Whenever I run a `bolt plan run`command, it always gives me this error
    Puppet is not installed on the target, please install it to enable 'apply'
    But when checking for the puppet version, it clearly returns a version which means Puppet is installed. I'm running this in an Ubuntu24 machine Any ideas whats causing this?
    b
    • 2
    • 29
  • d

    dm

    06/13/2025, 7:56 PM
    Ok, now I'm confused with the run_plan function. What is the definition of
    $nodes
    vs
    $targets
    ? If I have a plan with a
    TargetSpec $targets
    i want to call with
    run_plan
    . Do I use
    run_plan('myplan', $targets, {'something'=>true})
    or do I use
    run_plan('myplan', {'targets'=>$targets,'something'=>true})
    ? Is it just a shorthand or does it behave differently?
    v
    s
    +2
    • 5
    • 5
  • c

    CVQuesty

    06/13/2025, 8:03 PM
    are you in PE? My understanding is
    bolt plan run <name>
  • c

    CVQuesty

    06/13/2025, 8:04 PM
    ```$ bolt help plan Name plan Usage bolt plan <action> [options] Description Convert, create, show, and run Bolt plans. Documentation Learn more about Bolt plans at https://pup.pt/bolt-plans. Actions convert Convert a YAML plan to a Bolt plan new Create a new plan in the current project run Run a plan on the specified targets show Show available plans and plan documentation Global options -h, --help Display help. --version Display the version. --log-level LEVEL Set the log level for the console. Available options are trace, debug, info, warn, error, fatal. --clear-cache Clear plugin, plan, and task caches before executing.
  • d

    dm

    06/13/2025, 8:07 PM
    Not in PE. I'm asking from writing an own plan which calls another plan, so I'm within writing plans context