Skip to content

tootctl media remove-orphans: TypeError: no implicit conversion of nil into String #13168

@angristan

Description

@angristan

After processing a few hundred thousands media files, tootctl crashed:

bundler: failed to load command: bin/tootctl (bin/tootctl)--=---=---=---=---=---=---=---=---=-|  ETA: ??:??:??
TypeError: no implicit conversion of nil into String
  /home/mastodon/live/app/models/media_attachment.rb:180:in `extname'
  /home/mastodon/live/app/models/media_attachment.rb:180:in `variant?'
  /home/mastodon/live/lib/mastodon/media_cli.rb:91:in `block (2 levels) in remove_orphans'
  /home/mastodon/live/lib/mastodon/media_cli.rb:85:in `each'
  /home/mastodon/live/lib/mastodon/media_cli.rb:85:in `block in remove_orphans'
  /home/mastodon/live/lib/mastodon/media_cli.rb:69:in `loop'
  /home/mastodon/live/lib/mastodon/media_cli.rb:69:in `remove_orphans'
  /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
  /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
  /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
  /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:115:in `invoke'
  /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:238:in `block in subcommand'
  /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
  /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
  /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
  /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
  bin/tootctl:5:in `<top (required)>'

Let me know if I can do anything to provide more information, like issuing a specific SQL query.

Specifications

v3.1.2

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