skipcheck

tm1cm · Walkthrough 5 of 5

Run tm1cm unattended

In CI or a scheduled job there's nobody to type a password or sign in. tm1cm asks nothing there, and its exit code and log say what happened.

  • tm1cm only asks when it runs in a terminal. Elsewhere, a password that isn't set is sent empty, and anything else it needs ends the run with a message naming the setting.
  • Give the password from your CI's secrets with --connect password=... (-c), so it's never in a file: every setting can be given this way. Or set cam_passport for a CAM server.
  • A browser sign-in can't happen without a person: use a namespace that takes a password, or a passport.
  1. A run that works exits with 0:

    Terminal

    tm1cm --mode get --environment test > get.log 2>&1; echo "exit code: $?"

    Output

    exit code: 0

    PowerShell

    tm1cm --mode get --environment test *> get.log; "exit code: $LASTEXITCODE"

    Output, as on macOS

    exit code: 0
  2. A server that isn't there exits with 3:

    Terminal

    tm1cm --mode get --environment test -c base_url=http://localhost:1 > get.log 2>&1; echo "exit code: $?"

    Output

    exit code: 3

    PowerShell

    tm1cm --mode get --environment test -c base_url=http://localhost:1 *> get.log; "exit code: $LASTEXITCODE"

    Output, as on macOS

    exit code: 3

    and the end of the output says what went wrong, and what to check:

    Terminal

    tail -4 get.log

    Output

    2026-01-01 09:00:00,000 - tm1cm.login - authenticator(415) - INFO - Logging in to http://localhost:1 with basic
    tm1cm: Couldn't reach TM1 at http://localhost:1: [Errno 61] Connection refused
    Check base_url (or address, port and ssl) in connect.yaml, and that the server is running.
    The full report is in ~/projects/sales/sales.log. Attach it if you report an issue at https://github.com/ajmyers/tm1cm/issues

    PowerShell

    Get-Content get.log -Tail 4

    Output, as on macOS

    2026-01-01 09:00:00,000 - tm1cm.login - authenticator(415) - INFO - Logging in to http://localhost:1 with basic
    tm1cm: Couldn't reach TM1 at http://localhost:1: [Errno 61] Connection refused
    Check base_url (or address, port and ssl) in connect.yaml, and that the server is running.
    The full report is in ~/projects/sales/sales.log. Attach it if you report an issue at https://github.com/ajmyers/tm1cm/issues
  3. A login TM1 refuses exits with 4:

    Terminal

    tm1cm --mode get --environment test -c password=not-the-password > get.log 2>&1 < /dev/null; echo "exit code: $?"

    Output

    exit code: 4

    PowerShell

    $null | tm1cm --mode get --environment test -c password=not-the-password *> get.log; "exit code: $LASTEXITCODE"

    Output, as on macOS

    exit code: 4

    Terminal

    tail -4 get.log

    Output

    2026-01-01 09:00:00,000 - skipcheck_tm1 - _login_locked(218) - WARNING - TM1 at http://localhost:8011/api/v1/ refused the login as Basic admin; not trying again for 30.0s
    tm1cm: TM1 refused the login for admin at http://localhost:8011.
    Check user and password in credentials.yaml.
    The full report is in ~/projects/sales/sales.log. Attach it if you report an issue at https://github.com/ajmyers/tm1cm/issues

    PowerShell

    Get-Content get.log -Tail 4

    Output, as on macOS

    2026-01-01 09:00:00,000 - skipcheck_tm1 - _login_locked(218) - WARNING - TM1 at http://localhost:8011/api/v1/ refused the login as Basic admin; not trying again for 30.0s
    tm1cm: TM1 refused the login for admin at http://localhost:8011.
    Check user and password in credentials.yaml.
    The full report is in ~/projects/sales/sales.log. Attach it if you report an issue at https://github.com/ajmyers/tm1cm/issues

A script or CI job can tell what went wrong from the exit code: 2 for a setting, file or argument, 3 when TM1 can't be reached, 4 when the login is refused, 5 when TM1 refused some objects (the rest were done, and the failures are listed at the end), and 70 for something unexpected. Every exit code.

Every run writes <project>.log in the folder it runs in (--log names another): what it did, and when something goes wrong, a full report with the traceback, the versions and the servers. Passwords and passports are masked in it. Attach it when you report an issue. --debug adds every request tm1cm sends.

All the settings, filters, options and exit codes are in the reference.