Uploaded image for project: 'MusicBrainz Virtual Machines'
  1. MusicBrainz Virtual Machines
  2. MBVM-97

"sir reindex" fails with "urlopen error unknown url type: search"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2024-04-10-hotfix
    • None

      I have musicbrainz-docker set up for MBS development as described at
      https://github.com/metabrainz/musicbrainz-docker?tab=readme-ov-file#local-development-of-musicbrainz-server on a Debian 12.5 system.

      I'm having trouble getting indexed search working, though. When I try to build
      search indexes as described at
      https://github.com/metabrainz/musicbrainz-docker?tab=readme-ov-file#set-up-search-indexes,
      I get an error:

      % sudo docker-compose exec indexer python -m sir reindex
      2024-04-10 12:27:19,771: Checking whether the versions of the Solr cores are supported
      Traceback (most recent call last):
        File "/usr/local/lib/python2.7/runpy.py", line 174, in _run_module_as_main
          "__main__", fname, loader, pkg_name)
        File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
          exec code in run_globals
        File "/code/sir/__main__.py", line 134, in <module>
          main()
        File "/code/sir/__main__.py", line 130, in main
          func(args)
        File "sir/indexing.py", line 54, in reindex
          util.check_solr_cores_version(entities)
        File "sir/util.py", line 123, in check_solr_cores_version
          map(solr_version_check, cores)
        File "sir/util.py", line 106, in solr_version_check
          u = urllib2.urlopen("%s/%s/schema/version" % (solr_uri, core))
        File "/usr/local/lib/python2.7/urllib2.py", line 154, in urlopen
          return opener.open(url, data, timeout)
        File "/usr/local/lib/python2.7/urllib2.py", line 429, in open
          response = self._open(req, data)
        File "/usr/local/lib/python2.7/urllib2.py", line 452, in _open
          'unknown_open', req)
        File "/usr/local/lib/python2.7/urllib2.py", line 407, in _call_chain
          result = func(*args)
        File "/usr/local/lib/python2.7/urllib2.py", line 1266, in unknown_open
          raise URLError('unknown url type: %s' % type)
      urllib2.URLError: <urlopen error unknown url type: search>
      

      I noticed that the same error was also mentioned a few days ago at
      https://github.com/metabrainz/musicbrainz-docker/issues/274#issuecomment-2041325972.

      Search appears to be running:

      % sudo docker-compose ps
                    Name                            Command               State                               Ports
      -----------------------------------------------------------------------------------------------------------------------------------------
      musicbrainz-docker_db_1            docker-entrypoint.sh postg ...   Up      5432/tcp
      musicbrainz-docker_indexer_1       /sbin/my_init                    Up
      musicbrainz-docker_mq_1            /docker-entrypoint-wrapper.sh    Up      15671/tcp, 15672/tcp, 25672/tcp, 4369/tcp, 5671/tcp, 5672/tcp
      musicbrainz-docker_musicbrainz_1   docker-entrypoint.sh start.sh    Up      0.0.0.0:5000->5000/tcp
      musicbrainz-docker_redis_1         docker-entrypoint.sh redis ...   Up      6379/tcp
      musicbrainz-docker_search_1        docker-entrypoint.sh solr- ...   Up      8983/tcp
      musicbrainz-docker_validator_1     ./vnu-runtime-image/bin/ja ...   Up      8888/tcp
      

      I don't know anything about Solr, but I don't see any obvious problems in the
      output from sudo docker-compose logs --follow search. Here are the last few
      lines (nothing more is logged when I run the sir reindex command:

      ...
      search_1       | 2024-04-10 12:34:21.068 INFO  (coreLoadExecutor-9-thread-3) [   ] o.a.s.u.CommitTracker Hard AutoCommit: if uncommitted for 60000ms;·
      search_1       | 2024-04-10 12:34:21.068 INFO  (coreLoadExecutor-9-thread-3) [   ] o.a.s.u.CommitTracker Soft AutoCommit: if uncommitted for 10000ms;·
      search_1       | 2024-04-10 12:34:21.074 INFO  (coreLoadExecutor-9-thread-3) [   ] o.a.s.s.SolrIndexSearcher Opening [Searcher@74d7937e[work] main]
      search_1       | 2024-04-10 12:34:21.075 INFO  (coreLoadExecutor-9-thread-3) [   ] o.a.s.r.ManagedResourceStorage File-based storage initialized to use dir: /opt/solr/server/solr/mycores/mbsssss/work/conf
      search_1       | 2024-04-10 12:34:21.077 INFO  (coreLoadExecutor-9-thread-3) [   ] o.a.s.u.UpdateLog Could not find max version in index or recent updates, using new clock 1795951124626276352
      search_1       | 2024-04-10 12:34:21.083 INFO  (searcherExecutor-70-thread-1) [   ] o.a.s.c.SolrCore [work] Registered new searcher Searcher@74d7937e[work] main{ExitableDirectoryReader(UninvertingDirectoryReader())}
      

            yvanzo yvanzo
            derat derat
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2024-04-10-hotfix