Skip to content

If Travis API is unavailable, gem throws FrozenError rather than a helpful message #753

Closed
@dnwe

Description

@dnwe

By coincidence our Travis Enterprise endpoint was returning HTTP 500s for a period. However, from the Travis gem used in our automation this manifested as a "can't modify frozen Hash (FrozenError)" error rather than a helpful message showing that the problem was with the API rather than the CLI.

/ # ruby --version
ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-linux-musl]

/ # travis --version
1.9.1

/ # travis endpoint --set-default -X --api-endpoint https://travis.example.com/api
can't modify frozen Hash

/ # travis endpoint -E --debug --debug-http --set-default -X --api-endpoint https://travis.example.com/api
** Loading "/home/example/.travis/config.yml"
Traceback (most recent call last):
        7: from /usr/bin/travis:23:in `<main>'
        6: from /usr/bin/travis:23:in `load'
        5: from /usr/lib/ruby/gems/2.5.0/gems/travis-1.9.1/bin/travis:18:in `<top (required)>'
        4: from /usr/lib/ruby/gems/2.5.0/gems/travis-1.9.1/lib/travis/cli.rb:64:in `run'
        3: from /usr/lib/ruby/gems/2.5.0/gems/travis-1.9.1/lib/travis/cli/command.rb:199:in `execute'
        2: from /usr/lib/ruby/gems/2.5.0/gems/travis-1.9.1/lib/travis/cli/api_command.rb:53:in `setup'
        1: from /usr/lib/ruby/gems/2.5.0/gems/travis-1.9.1/lib/travis/cli/api_command.rb:114:in `setup_enterprise'
/usr/lib/ruby/gems/2.5.0/gems/travis-1.9.1/lib/travis/cli/api_command.rb:114:in `delete': can't modify frozen Hash (FrozenError)

/ # curl -sS https://travis.example.com/api/
<html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>nginx/1.16.1</center>
</body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions