[opensuse-buildservice] How to make use or get rid of https://<local-obs-instance>/search ?

Hi, the builtin search function doesn't seem to work in our internal obs 2.8 instance. It fails with 500: Internal Server Error It also allows to search within various external systems. Can search into external systems be disabled? How to make internal search work? In the logs I see: I, [2018-03-01T08:07:30.069322 #1051] INFO -- : [3c5c7815-d750-4e5c-9324-672c2d9df041] [1051:29239.76] Started GET "/search?utf8=%E2%9C%93&search_text=test&commit=Submit+Query&issue_tracker=bnc&issue=&project=0&project=1&package=0&package=1&name=0&name=1&title=0&description=0&attrib_type_id=" for 10.10.10.249 at 2018-03-01 08:07:30 +0100 I, [2018-03-01T08:07:30.080704 #1051] INFO -- : [3c5c7815-d750-4e5c-9324-672c2d9df041] [1051:29239.77] Processing by Webui::SearchController#index as HTML I, [2018-03-01T08:07:30.080953 #1051] INFO -- : [3c5c7815-d750-4e5c-9324-672c2d9df041] [1051:29239.77] Parameters: {"utf8"=>"✓", "search_text"=>"test", "commit"=>"Submit Query", "issue_tracker"=>"bnc", "issue"=>"", "project"=>"1", "package"=>"1", "name"=>"1", "title"=>"0", "description"=>"0", "attrib_type_id"=>""} I, [2018-03-01T08:07:30.132015 #1051] INFO -- : [3c5c7815-d750-4e5c-9324-672c2d9df041] [1051:29239.83] Completed 500 Internal Server Error in 51ms (ActiveRecord: 0.0ms | Backend: 0.0ms | XML: 0.0ms) F, [2018-03-01T08:07:30.147233 #1051] FATAL -- : [3c5c7815-d750-4e5c-9324-672c2d9df041] [1051:29239.84] F, [2018-03-01T08:07:30.147515 #1051] FATAL -- : [3c5c7815-d750-4e5c-9324-672c2d9df041] [1051:29239.84] ThinkingSphinx::ConnectionError (Error connecting to Sphinx via the MySQL protocol. Error connecting to Sphinx via the MySQL protocol. Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused") - SELECT *, (weight() + 100 * linked_count + -1000 * links_to_other + 1000 * is_devel + 500 * (activity_index * POW( 2.3276, (updated_at - 1519888050) / 10000000))) as adjusted_weight FROM `package_core`, `project_core` WHERE MATCH('@(name) test') AND `sphinx_deleted` = 0 AND `project_id` NOT IN (0) ORDER BY `adjusted_weight` DESC LIMIT 0, 20 OPTION field_weights=(name=10, title=2, description=1), max_matches=15000, ranker=sph04; SHOW META): F, [2018-03-01T08:07:30.147640 #1051] FATAL -- : [3c5c7815-d750-4e5c-9324-672c2d9df041] [1051:29239.84] F, [2018-03-01T08:07:30.147747 #1051] FATAL -- : [3c5c7815-d750-4e5c-9324-672c2d9df041] [1051:29239.84] app/controllers/webui/search_controller.rb:82:in `search' [3c5c7815-d750-4e5c-9324-672c2d9df041] app/controllers/webui/search_controller.rb:7:in `index' [3c5c7815-d750-4e5c-9324-672c2d9df041] config/initializers/wrap_parameters.rb:38:in `call' ==> /srv/www/obs/api/log/apache_access.log <== 10.10.10.249 - - [01/Mar/2018:08:07:30 +0100] "GET /search?utf8=%E2%9C%93&search_text=test&commit=Submit+Query&issue_tracker=bnc&issue=&project=0&project=1&package=0&package=1&name=0&name=1&title=0&description=0&attrib_type_id= HTTP/1.1" 500 4322 ==> /srv/www/obs/api/log/production.log <== I, [2018-03-01T08:07:30.268687 #1051] INFO -- : [1c81b044-0d0d-4966-b10d-43169b6b070d] [1051:29239.96] Started GET "/favicon.ico" for 10.10.10.249 at 2018-03-01 08:07:30 +0100 F, [2018-03-01T08:07:30.272464 #1051] FATAL -- : [1c81b044-0d0d-4966-b10d-43169b6b070d] [1051:29239.97] F, [2018-03-01T08:07:30.272791 #1051] FATAL -- : [1c81b044-0d0d-4966-b10d-43169b6b070d] [1051:29239.97] ActionController::RoutingError (No route matches [GET] "/favicon.ico"): F, [2018-03-01T08:07:30.272886 #1051] FATAL -- : [1c81b044-0d0d-4966-b10d-43169b6b070d] [1051:29239.97] F, [2018-03-01T08:07:30.273059 #1051] FATAL -- : [1c81b044-0d0d-4966-b10d-43169b6b070d] [1051:29239.97] actionpack (5.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:53:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] actionpack (5.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] railties (5.0.1) lib/rails/rack/logger.rb:36:in `call_app' [1c81b044-0d0d-4966-b10d-43169b6b070d] railties (5.0.1) lib/rails/rack/logger.rb:24:in `block in call' [1c81b044-0d0d-4966-b10d-43169b6b070d] activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `block in tagged' [1c81b044-0d0d-4966-b10d-43169b6b070d] activesupport (5.0.1) lib/active_support/tagged_logging.rb:26:in `tagged' [1c81b044-0d0d-4966-b10d-43169b6b070d] activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `tagged' [1c81b044-0d0d-4966-b10d-43169b6b070d] railties (5.0.1) lib/rails/rack/logger.rb:24:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] actionpack (5.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] rack (2.0.1) lib/rack/method_override.rb:22:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] rack (2.0.1) lib/rack/runtime.rb:22:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] activesupport (5.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] rack (2.0.1) lib/rack/lock.rb:15:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] rack (2.0.1) lib/rack/sendfile.rb:111:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] hoptoad_notifier (2.4.11) lib/hoptoad_notifier/user_informer.rb:12:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] railties (5.0.1) lib/rails/engine.rb:522:in `call' [1c81b044-0d0d-4966-b10d-43169b6b070d] railties (5.0.1) lib/rails/railtie.rb:193:in `public_send' [1c81b044-0d0d-4966-b10d-43169b6b070d] railties (5.0.1) lib/rails/railtie.rb:193:in `method_missing' [1c81b044-0d0d-4966-b10d-43169b6b070d] passenger (5.0.30) src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request' [1c81b044-0d0d-4966-b10d-43169b6b070d] passenger (5.0.30) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:152:in `accept_and_process_next_request' [1c81b044-0d0d-4966-b10d-43169b6b070d] passenger (5.0.30) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop' [1c81b044-0d0d-4966-b10d-43169b6b070d] passenger (5.0.30) src/ruby_supportlib/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads' [1c81b044-0d0d-4966-b10d-43169b6b070d] passenger (5.0.30) src/ruby_supportlib/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception' So I searched for "sphinx" and only found this: http://openbuildservice.org/help/manuals/obs-reference-guide/cha.obs.admin.h... When I try to start the searchd.service, it fails: ● searchd.service - Sphinx - SQL Full Text Search Engine Loaded: loaded (/usr/lib/systemd/system/searchd.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2018-03-01 08:19:24 CET; 4min 44s ago Process: 13214 ExecStart=/usr/bin/searchd --nodetach --config /etc/sphinx/sphinx.conf (code=exited, status=1/FAILURE) Main PID: 13214 (code=exited, status=1/FAILURE) Mar 01 08:19:24 buildservice searchd[13214]: Copyright (c) 2001-2016, Andrew Aksyonoff Mar 01 08:19:24 buildservice searchd[13214]: Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com) Mar 01 08:19:24 buildservice searchd[13214]: precaching index 'test1' Mar 01 08:19:24 buildservice searchd[13214]: WARNING: index 'test1': preload: failed to open /var/lib/sphinx/data/test1.sph: No such file or directory; NOT SERVING Mar 01 08:19:24 buildservice searchd[13214]: precaching index 'test1stemmed' Mar 01 08:19:24 buildservice searchd[13214]: WARNING: index 'test1stemmed': preload: failed to open /var/lib/sphinx/data/test1stemmed.sph: No such file or directory; NOT SERVING Mar 01 08:19:24 buildservice searchd[13214]: precaching index 'rt' Mar 01 08:19:24 buildservice systemd[1]: searchd.service: Main process exited, code=exited, status=1/FAILURE Mar 01 08:19:24 buildservice systemd[1]: searchd.service: Unit entered failed state. Mar 01 08:19:24 buildservice systemd[1]: searchd.service: Failed with result 'exit-code'. Is there some documentation about this integration? Or can I at least disable that in the ui? -- kind regards, Carsten Hoeger Professional Services Phone: +49 2761 75252 00 Fax: +49 2761 75252 30 Email: carsten.hoeger@open-xchange.com ------------------------------------------------------------------------------------- Open-Xchange AG, Rollnerstr. 14, 90408 Nuremberg, District Court Nuremberg HRB 24738 Managing Board: Rafael Laguna de la Vera, Carsten Dirks, Michael Knapstein, Stephan Martin Chairman of the Board: Richard Seibt European Office: Open-Xchange GmbH, Olper Huette 5f, D-57462 Olpe, Germany, District Court Siegen, HRB 8718 Managing Director: Frank Hoberg US Office: Open-Xchange. Inc., 530 Lytton Avenue, Palo Alto, CA 94301, USA -------------------------------------------------------------------------------------

On 03/01/2018 08:29 AM, Carsten Hoeger wrote:
How to make internal search work?
In the logs I see:
[...] Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused") [...]
This seems to be the cause ... Have a nice day, Berny -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org

Hi,
On 01 March 2018 at 09:14 Bernhard Voelker <mail@bernhard-voelker.de> wrote:
On 03/01/2018 08:29 AM, Carsten Hoeger wrote:
How to make internal search work?
In the logs I see:
[...] Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused") [...]
This seems to be the cause ...
Quite likely, yes.. Still, the questions remain: Is there some documentation about this integration? Or can I at least disable that in the ui? -- kind regards, Carsten Hoeger Professional Services Phone: +49 2761 75252 00 Fax: +49 2761 75252 30 Email: carsten.hoeger@open-xchange.com ------------------------------------------------------------------------------------- Open-Xchange AG, Rollnerstr. 14, 90408 Nuremberg, District Court Nuremberg HRB 24738 Managing Board: Rafael Laguna de la Vera, Carsten Dirks, Michael Knapstein, Stephan Martin Chairman of the Board: Richard Seibt European Office: Open-Xchange GmbH, Olper Huette 5f, D-57462 Olpe, Germany, District Court Siegen, HRB 8718 Managing Director: Frank Hoberg US Office: Open-Xchange. Inc., 530 Lytton Avenue, Palo Alto, CA 94301, USA -------------------------------------------------------------------------------------

On Donnerstag, 1. März 2018, 09:35:15 CET wrote Carsten Hoeger:
Hi,
On 01 March 2018 at 09:14 Bernhard Voelker <mail@bernhard-voelker.de> wrote:
On 03/01/2018 08:29 AM, Carsten Hoeger wrote:
How to make internal search work?
In the logs I see:
[...] Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused") [...]
this is usually not the real MySQL server, but the searchd which offers also a mysql interface ... And the crash is usually caused by a not running searchd. In your version it should have been started by clockworkd. try to run in manually by running rake.ruby2.X ts:index ts:start as the right user (www?). The most popular reason why searchd is not starting is some left over file with wrong ownership. So I would rm -rf /srv/www/obs/api/tmp/binlog /srv/www/obs/api/log/production.searchd.log /srv/www/obs/api/log/production.searchd.query.log /srv/www/obs/api/log/production.sphinx.pid before. ...
Or can I at least disable that in the ui?
no -- Adrian Schroeter email: adrian@suse.de SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) Maxfeldstraße 5 90409 Nürnberg Germany -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org

Hi,
On 1. Mar 2018, at 11:52 , Adrian Schröter <adrian@suse.de> wrote:
How to make internal search work?
In the logs I see:
[...] Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused") [...]
this is usually not the real MySQL server, but the searchd which offers also a mysql interface ...
And the crash is usually caused by a not running searchd.
In your version it should have been started by clockworkd. try to run in manually by running
rake.ruby2.X ts:index ts:start
as the right user (www?).
The most popular reason why searchd is not starting is some left over file with wrong ownership. So I would
rm -rf /srv/www/obs/api/tmp/binlog /srv/www/obs/api/log/production.searchd.log /srv/www/obs/api/log/production.searchd.query.log /srv/www/obs/api/log/production.sphinx.pid
before.
That was a good hint. binlog was indeed not owned by wwwrun. Found the clean-restart method of the obsapidelayed init-script and after that, it works. I wonder why, since that is a fresh 2.8 installation, but the following fixed it: # /etc/init.d/obsapidelayed clean-restart redirecting to systemctl stop obsapidelayed.service /usr/lib64/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated /usr/lib64/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated /usr/lib64/ruby/gems/2.4.0/gems/activejob-5.0.1/lib/active_job/arguments.rb:38: warning: constant ::Fixnum is deprecated /usr/lib64/ruby/gems/2.4.0/gems/activejob-5.0.1/lib/active_job/arguments.rb:38: warning: constant ::Bignum is deprecated /usr/lib64/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/core_ext/numeric/conversions.rb:138: warning: constant ::Fixnum is deprecated Generating configuration to /srv/www/obs/api/config/production.sphinx.conf Sphinx 2.2.11-id64-release (95ae9a6) Copyright (c) 2001-2016, Andrew Aksyonoff Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com) using config file '/srv/www/obs/api/config/production.sphinx.conf'... WARNING: key 'max_matches' was permanently removed from Sphinx configuration. Refer to documentation for details. indexing index 'package_core'... collected 25401 docs, 1.3 MB collected 21 attr values sorted 0.0 Mvalues, 100.0% done sorted 0.2 Mhits, 100.0% done total 25401 docs, 1291159 bytes total 1.661 sec, 777046 bytes/sec, 15286.85 docs/sec indexing index 'project_core'... collected 1506 docs, 0.1 MB collected 21 attr values sorted 0.0 Mvalues, 100.0% done sorted 0.0 Mhits, 100.0% done total 1506 docs, 67107 bytes total 0.899 sec, 74608 bytes/sec, 1674.34 docs/sec skipping non-plain index 'package'... skipping non-plain index 'project'... total 26937 reads, 0.014 sec, 0.1 kb/call avg, 0.0 msec/call avg total 28 writes, 0.007 sec, 175.1 kb/call avg, 0.2 msec/call avg redirecting to systemctl start obsapidelayed.service -- kind regards, Carsten Hoeger Professional Services Email: carsten.hoeger@open-xchange.com ------------------------------------------------------------------------------ Open-Xchange AG, Rollnerstr. 14, 90408 Nuremberg, District Court Nuremberg HRB 24738 Managing Board: Rafael Laguna de la Vera, Carsten Dirks, Michael Knapstein, Stephan Martin Chairman of the Board: Richard Seibt European Office: Open-Xchange GmbH, Olper Huette 5f, D-57462 Olpe, Germany, District Court Siegen, HRB 8718 Managing Director: Frank Hoberg US Office: Open-Xchange. Inc., 530 Lytton Avenue, Palo Alto, CA 94301, USA ------------------------------------------------------------------------------
participants (4)
-
Adrian Schröter
-
Bernhard Voelker
-
Carsten Hoeger
-
Carsten Höger