Sphinx installation Fails to configure with MySQL - mysql

When I run the ThinkingSphinx index task bundle exec rake ts:index I get an error. Namely,
unknown type 'mysql'; skipping.
ERROR LOG: Generating configuration to
../../config/development.sphinx.conf Sphinx 2.2.4-id64-release (r4806)
Copyright (c) 2001-2014, Andrew Aksyonoff Copyright (c) 2008-2014,
Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '../../config/development.sphinx.conf'... WARNING:
key 'sql_query_info' was permanently removed from Sphinx
configuration. Refer to documentation for details. WARNING: key
'charset_type' was permanently removed from Sphinx configuration.
Refer to documentation for details. indexing index 'video_core'...
ERROR: source 'video_core_0': unknown type 'mysql'; skipping. ERROR:
index 'video_core': failed to configure some of the sources, will not
index. skipping non-plain index 'video'... total 0 reads, 0.000 sec,
0.0 kb/call avg, 0.0 msec/call avg total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
Failed Solutions:
Re-install Sphinx using Homebrew on Mavericks.
brew install sphinx --with-mysql=/usr/local/Cellar/mysql/5.6.20_1/include/mysql
brew install sphinx --with-mysql

I'm not sure why it's not picking up your existing MySQL installation... but you could try compiling by hand instead, see if that works?
http://pat.github.io/thinking-sphinx/installing_sphinx.html

Related

Getting ERROR: unknown key name ‘docinfo’ on sharetribe installation

I've been struggling to run bundle exec rake ts:index in my sharetribe project. It's returning an error:
rony#ronyMacMini sharetribe % bundle exec rake ts:index
Generating configuration to /Users/rony/Documents/freelensia Ofc/sharetribe/config/development.sphinx.conf
DEBUG (1.0ms) SET NAMES utf8, ##SESSION.sql_mode = CONCAT(CONCAT(##sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), ##SESSION.sql_auto_is_null = 0, ##SESSION.wait_timeout = 2147483
DEBUG ↳ app/indices/custom_field_value_index.rb:8
DEBUG Delayed::Backend::ActiveRecord::Job Destroy (4.2ms) DELETE FROM `delayed_jobs` WHERE (handler LIKE ('--- !ruby/object:ThinkingSphinx::Deltas::%') AND locked_at IS NULL AND locked_by IS NULL AND failed_at IS NULL)
DEBUG ↳ /Users/rony/.rvm/gems/ruby-2.6.5/bin/rake:23
Sphinx 3.3.1 (commit b72d67bc)
Copyright (c) 2001-2020, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/Users/rony/Documents/abc/sharetribe/config/development.sphinx.conf'...
ERROR: unknown key name 'docinfo' in /Users/rony/Documents/abc/sharetribe/config/development.sphinx.conf line 40 col 10.
FATAL: failed to parse config file '/Users/rony/Documents/abc/sharetribe/config/development.sphinx.conf'
The Sphinx indexing command failed:
Command: indexer --config "/Users/rony/Documents/abc/sharetribe/config/development.sphinx.conf" --all
Status: 1
Output: See above
There may be more information about the failure in /Users/rony/Documents/abc/sharetribe/log/development.searchd.log.
Note that: To install thinking-sphinx on my mac, I’ve downloaded a
pre-built set of binaries and copy-pasted content of bin inside
usr/local/bin.
Searched everywhere but couldn't found the solution. I'm sure I'm missing some stupid thing.
Please help me to fix it.
Update
Downgraded sphinx to 2.2.11. Now another issue raised:
dyld: Library not loaded: /opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib
Referenced from: /usr/local/bin/indexer
Reason: image not found
zsh: abort indexer
I think /opt/local is not correct system directory format for mac. :(
This is due to recent versions of Sphinx removing the docinfo setting.
Which version of Thinking Sphinx is Sharetribe using? If it's 4.x, you can disable the docinfo settings by adding skip_docinfo: true to each appropriate environment in config/thinking_sphinx.yml. For example:
development:
skip_docinfo: true
In Thinking Sphinx v5.0, docinfo is no longer used, but upgrading requires a bit of work with adding callbacks to all indexed models.
If you're using Thinking Sphinx v3.x, then you'll need to downgrade your version of Sphinx to v2.2.11.

Thinking Sphinx migration without enabled local indexes

in migrating from rails 3.2 (where running as per design) to rails 4.2, an application with ThinkingSphinx on 4.2 will run rebuildand restart, however indexes are not being created with the following error stream
using config file '/Users/main/r/saim/config/development.sphinx.conf'...
WARNING: key 'sql_query_info' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'sql_query_info' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'sql_query_info' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: 7 more warnings skipped.
indexing index 'azienda_core'...
ERROR: source 'azienda_core_0': unknown type 'pgsql'; skipping.
ERROR: index 'azienda_core': failed to configure some of the sources, will not index.
thiking_sphinx.yml is configured as:
development:
bin_path: /usr/local/bin
pid_file: /Users/main/r/saim/shared/tmp/searchd.pid
configuration_file: /Users/main/r/saim/config/development.sphinx.conf
indices_location: /Users/main/r/saim/shared/sphinx
use_64_bit: true
# enable_star: true
min_infix_len: 2
# max_matches: 1000
mysql41: 9313
mem_limit: 128M
utf8: true
and sphinx.yml (I attempted both with and without spinx.yml in the config folder with identical results)
development:
bin_path: /usr/local/bin
searchd_file_path: /Users/main/r/saim/shared/sphinx
use_64_bit: true
enable_star: 1
min_infix_len: 1
max_matches: 10000
port: 9313
installed gems are
gem 'mysql2', '0.3.18', :platform => :ruby
gem 'thinking-sphinx', '3.1.2'
not sure why pgsql is the hangup...
Sphinx is saying it's not configured for PostgreSQL support. Have you re-installed Sphinx recently? And did you explicitly configure for PostgreSQL support when doing so? That's not the default, so you'll need to use the appropriate configuration flag when doing so. I believe it's --with-postgresql when using Homebrew, and it's certainly --with-pgsql when compiling manually.

Compiling MySQL 5.6 for Raspberry Pi - validation error

I am trying to compile MySQL 5.6 for install onto a Raspberry Pi (I need it for a geo module that wont work on 5.5, sigh...).
I am attempting it like so, at someone else's recommendation:
apt-get install build-essential debhelper devscripts debian-keyring
dget http://ftp.de.debian.org/debian/pool/main/m/mysql-5.6/mysql-5.6_5.6.19-1~exp1.dsc
cd mysql-5.6-5.6.19
dpkg-buildpackage -b
(install any missing build dependencies it compalins about)
dpkg-buildpackage -b
But, it errors on the second command:
pi#raspberrypi ~ $ dget http://ftp.de.debian.org/debian/pool/main/m/mysql-5.6/mysql-5.6_5.6.19-1~exp1.dsc
dget: retrieving http://ftp.de.debian.org/debian/pool/main/m/mysql-5.6/mysql-5.6_5.6.19-1~exp1.dsc
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2703 100 2703 0 0 16084 0 --:--:-- --:--:-- --:--:-- 30715
dget: using existing mysql-5.6_5.6.19.orig.tar.gz
dget: using existing mysql-5.6_5.6.19-1~exp1.debian.tar.xz
mysql-5.6_5.6.19-1~exp1.dsc:
dscverify: mysql-5.6_5.6.19-1~exp1.dsc failed signature check:
gpg: keyblock resource `/home/pi/.gnupg/secring.gpg': file open error
gpg: Signature made Mon 21 Jul 2014 15:08:15 UTC using RSA key ID A0E7D8C3
gpg: fatal: /home/pi/.gnupg: directory does not exist!
secmem usage: 1408/1408 bytes in 2/2 blocks of pool 1408/32768
Validation FAILED!!
Anyone any idea why?
I did have to abort on the first attempt due to a power cut... I think during the first or second command was being executed... could this have screwed it up at all? Any way to rectify if so?
This helps:
sudo gpg -k
Then install any missing packages that it errors on and then go for the final build/compile.
I got this same error, but my problem was that I wasn't running with elevated permissions. Once I ran the dget with sudo it worked.

Does Sphinx work with Postgres & rails 4?

Sphinx claims to work with postgres, but I've had no luck. I've installed the latest thinking-sphinx gem, and installed sphinx itself with both mysql and postgres. I still get an error when I try to build an index, like this:
ERROR: source 'user_core_0': unknown type 'pgsql'; skipping.
Full trace:
> rake ts:index
Generating configuration to /.../config/development.sphinx.conf
Sphinx 2.2.6-id64-release (r4843)
Copyright (c) 2001-2014, Andrew Aksyonoff
Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/.../config/development.sphinx.conf'...
WARNING: key 'sql_query_info' was permanently removed from Sphinx configuration. Refer to documentation for details.
WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details.
indexing index 'user_core'...
ERROR: source 'user_core_0': unknown type 'pgsql'; skipping.
ERROR: index 'user_core': failed to configure some of the sources, will not index.
skipping non-plain index 'user'...
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
Edit:
I think sphinx should have pgsql support. How I installed sphinx:
> brew remove sphinx
Uninstalling /usr/local/Cellar/sphinx/2.2.6...
> brew install sphinx --mysql --pgsql
==> Downloading http://sphinxsearch.com/files/sphinx-2.2.6-release.tar.gz
Already downloaded: /Library/Caches/Homebrew/sphinx-2.2.6.tar.gz
==> Cloning https://github.com/snowballstem/snowball.git
Updating /Library/Caches/Homebrew/sphinx--stemmer--git
==> Checking out revision 9b58e92c965cd7e3208247ace3cc00d173397f3c
==> make dist_libstemmer_c
==> tar xzf dist/libstemmer_c.tgz -C /private/tmp/sphinx-oTMP63/sphinx-2.2.6-release
==> ./configure --prefix=/usr/local/Cellar/sphinx/2.2.6 --localstatedir=/usr/local/var --with-libstemmer --with-mysql --with-pgsql
==> make install
==> Caveats

Help with MySQL gem on OSX

I'm trying to get the mysql gem working on OSX 10.5.6, and feeling stymied.
% gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions. This could take a while...
Successfully installed mysql-2.7
1 gem installed
% irb -rubygems -rmysql
irb> Mysql.init
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /Users/rampion/.gem/gems/mysql-2.7/lib/mysql.bundle
Expected in: dynamic lookup
dyld: Symbol not found: _mysql_init
Referenced from: /Users/rampion/.gem/gems/mysql-2.7/lib/mysql.bundle
Expected in: dynamic lookup
zsh: trace trap irb -rubygems -rmysql
%
I'm using the default install of ruby 1.8.6.
I'm using a 64-bit version of MySQL 5.0.77. mysqld is running and I can use the mysql shell, so I suspect my issue is with mysql.gem, though I'm by no means certain.
Can anyone offer any advice?
Ok. So the solution turned out to be I needed to be runing the 32-bit version of MySQL 5.0.77 in order for mysql.gem to work.