Uploaded image for project: 'ListenBrainz'
  1. ListenBrainz
  2. LB-189

submitting multiple artists via "artist_name" causes internal server error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • API
    • None

      It's quite common for artist tags to have multiple values, even id3 supports it which is amazing.

      Here's an example payload I just tried...

      {
          "listen_type": "single",
          "payload": [
              {
                  "listened_at": 1499274896,
                  "track_metadata": {
                      "additional_info": {
                          "artist_mbids": [
                              "d0bd6ce2-4ff8-4609-b5ad-fbf6ae7fb09f",
                              "0b0c25f4-f31c-46a5-a4fb-ccbf53d663bd"
                          ]
                      },
                      "artist_name": [
                          "Natasha Khan",
                          "Jon Hopkins"
                      ],
                      "track_name": "Garden's Heart"
                  }
              }
          ]
      }
      

      and the response

      <!DOCTYPE html>
      <html>
      <head><meta charset="utf-8" />
          <title>Internal server error - ListenBrainz</title>
          <meta http-equiv="X-UA-Compatible" content="IE=edge" />
          <meta name="viewport" content="width=device-width, initial-scale=1" />
      
          <link rel="icon" sizes="16x16" href="/static/img/favicon-16.png" type="image/png" />
          <link rel="icon" sizes="256x256" href="/static/img/favicon-256.png" type="image/png" />
          <link rel="icon" sizes="32x32" href="/static/img/favicon-32.png" type="image/png" />
      
          
            <link href="/static/css/main.css" rel="stylesheet" media="screen" />
          </head>
      
      <body><nav class="navbar navbar-default navbar-static-top" role="navigation">
        <div class="container"><div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#lb-navbar-collapse">
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand logo" href="/">
                <img src="/static/img/navbar_logo.svg" alt="ListenBrainz" /><span class="alpha">pre-beta test</span>
            </a>
          </div><div class="collapse navbar-collapse" id="lb-navbar-collapse">
            <ul class="nav navbar-nav">
              <li><a href="/contribute">Contribute</a></li>
              <li><a href="/api-docs">API Docs</a></li>
              <li><a href="/roadmap">Roadmap</a></li>
              <li><a href="/goals">Goals</a></li>
              <li><a href="/faq">FAQ</a></li>
              <li><a href="/download">Downloads</a></li>
            </ul>
      
            
            </div>
      
        </div>
      </nav><div class="container">
      
          <div class = "alert alert-danger">
            <strong>Note:</strong> Please understand that ListenBrainz has not officially entered beta yet and that this is just a test version of ListenBrainz beta. We cannot promise that your data will remain intact as we're just testing out our code right now. After some time, we may need to delete all data and start from scratch. Please make sure that this version of ListenBrainz is not the only place your listen history is stored.
          </div>
      
          
            
          
        <h2 class="page-title">Internal server error</h2>
        <p>Something went wrong. Please try again.</p>
        <p><code>500: Internal Server Error</code></p>
        <p><a href="/">Back to home page</a></p>
      <div class="clearfix"></div><hr />
            <div class="footer clearfix">
              <ul class="list-inline pull-left">
                <li><a href="http://blog.musicbrainz.org/category/listenbrainz/">Blog</a></li>
                <li><a href="https://twitter.com/ListenBrainz">Twitter</a></li>
                <li><a href="https://github.com/metabrainz/listenbrainz-server/">GitHub</a></li>
                <li><a href="http://tickets.musicbrainz.org/browse/LB">Bug Tracker</a></li>
                <li><a href="/current-status">Status</a></li>
              </ul>
              <ul class="list-inline pull-right">
                <li><a href="https://musicbrainz.org" title="MusicBrainz"><img src="/static/img/musicbrainz.svg" /></a></li>
              </ul>
            </div></div><script src="/static/js/lib/jquery-2.1.0.min.js"></script>
          <script src="/static/js/lib/bootstrap.min.js"></script></body>
      </html>
      

      Now I'm happy for the rule to be string only but then you need to specify how you want it - first value only or comma separated list etc.

            iliekcomputers Param Singh
            marc2k3 marc
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package