I have installed Sphinx from source with pgsql and then installed thinking-sphinx gem(3.0.1) on my application (Rails 4.0.3). And I configured & generated the sphinx configurations. Then I added the indices on app/indices and later ran the index & start the sphinx via rake ts:index && ts:start, but I got the below error, let me know the way to resolve this.
rake ts:index
Generating configuration to /home/stc/presto/config/development.sphinx.conf
Sphinx 2.1.7-release (rel21-r4638)
Copyright (c) 2001-2014, Andrew Aksyonoff
Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/home/stc/config/development.sphinx.conf'...
FATAL: no indexes found in config file '/home/stc/config/development.sphinx.conf'
rake ts:start
In the log file I can see the below errors
[Wed Apr 2 10:40:49.834 2014] [14338] Child process 14339 has been forked
[Wed Apr 2 10:40:49.835 2014] [14339] listening on 127.0.0.1:9306
[Wed Apr 2 10:40:49.835 2014] [14339] WARNING: ERROR: index 'collection_core': RT indexes support prefixes and infixes with only dict=keywords - NOT SERVING
[Wed Apr 2 10:40:49.836 2014] [14339] WARNING: ERROR: index 'resource_core': RT indexes support prefixes and infixes with only dict=keywords - NOT SERVING
[Wed Apr 2 10:40:49.836 2014] [14339] WARNING: index 'collection': no such local index 'collection_core' - SKIPPING LOCAL INDEX
[Wed Apr 2 10:40:49.836 2014] [14339] WARNING: index 'collection': no valid local/remote indexes in distributed index - NOT SERVING
[Wed Apr 2 10:40:49.836 2014] [14339] WARNING: index 'resource': no such local index 'resource_core' - SKIPPING LOCAL INDEX
[Wed Apr 2 10:40:49.836 2014] [14339] WARNING: index 'resource': no valid local/remote indexes in distributed index - NOT SERVING
[Wed Apr 2 10:40:49.836 2014] [14339] FATAL: no valid indexes to serve
[Wed Apr 2 10:40:49.836 2014] [14338] Child process 14339 has been finished, exit code 1. Watchdog finishes also. Good bye!
Addressed this on the Thinking Sphinx Google group as well:
You seem to be using real-time indices - which is great - but that means you don’t need to use the ts:index task. The two main tasks that are useful are:
ts:generate - which adds/updates all documents in each real-time index.
ts:regenerate - which stops Sphinx, clears out existing index files, generates the configuration, starts Sphinx and runs ts:generate.
However, you’re also using either min_infix_len or min_prefix_len - and with Sphinx 2.1, the default dict setting doesn’t match with what is needed (as the logs detail). So, if you add dict: keywords to the appropriate environments in config/thinking_sphinx.yml and then run ts:regenerate, you should hopefully have a working Sphinx setup.
Related
I'm running Django website on apache.
Here is the tail of my httpd.conf file.
ServerName 127.0.0.1:8080
# Django Project
LoadFile "c:/python39/python39.dll"
LoadModule wsgi_module "c:/python39/lib/site-packages/mod_wsgi/server/mod_wsgi.cp39-win_amd64.pyd"
WSGIPythonHome "c:/python39/"
WSGIScriptAlias / "C:/pd_videowebapp/mysite/wsgi.py"
WSGIPythonPath "C:/pd_videowebapp/"
<Directory "C:/pd_videowebapp/mysite/">
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Alias /static "C:/pd_videowebapp/static/"
<Directory "C:/pd_videowebapp/static/">
Require all granted
</Directory>
And here is the tail of the error.log file:
The 'Apache2.4' service is restarting.
Starting the 'Apache2.4' service
The 'Apache2.4' service is running.
pm_winnt:notice] [pid 4472:tid 420] AH00455: Apache/2.4.51 (Win64) mod_wsgi/4.9.0 Python/3.9 configured -- resuming normal operations
[Wed Oct 13 08:31:28.026005 2021] [mpm_winnt:notice] [pid 4472:tid 420] AH00456: Apache Lounge VS16 Server built: Oct 7 2021 16:27:02
[Wed Oct 13 08:31:28.026005 2021] [core:notice] [pid 4472:tid 420] AH00094: Command line: 'C:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Wed Oct 13 08:31:28.041641 2021] [mpm_winnt:notice] [pid 4472:tid 420] AH00418: Parent: Created child process 2676
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\Apache24\\bin\\httpd.exe'
sys.base_prefix = 'C:\\Python39'
sys.base_exec_prefix = 'C:\\Python39'
sys.platlibdir = 'lib'
sys.executable = 'C:\\Apache24\\bin\\httpd.exe'
sys.prefix = 'C:\\Python39'
sys.exec_prefix = 'C:\\Python39'
sys.path = [
'C:\\Python39\\python39.zip',
'.\\DLLs',
'.\\lib',
'C:\\Apache24\\bin',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00001bd8 (most recent call first):
<no Python frame>
[Wed Oct 13 08:31:28.385413 2021] [mpm_winnt:crit] [pid 4472:tid 420] AH00419: master_main: create child process failed. Exiting.
For Windows 10 users:
Press Windows logo on Toolbar.
Type and open Edit the system environment variables.
In Advance tab press Environment Variables button.
For System variables press New button.
Variable name will be PYTHONHOME and Variable value will the path where the python.exe is located (i.e. c:/users/administrator/anaconda3/envs/my_env_name). Then press OK.
Again for System variables press New button.
Variable name will be PYTHONPATH and Variable value will the path of site-packages folder (i.e. C:/Users/Administrator/anaconda3/envs/my_env_name/Lib/site-packages). Then press OK.
I have an ipa server running for over a year now.
Recently, when I try to add a new user via https or the terminal it fails with the following error message.
IPA-Fehler 4203: DatabaseError
Server is unwilling to perform: Managed Entry Plugin rejected add operation (see errors log).
In the error logs, I see:
[timestamp] [:warn] [pid 2731] [client xxx] failed to set perms (3140) on file (/var/run/ipa/ccaches/user#xxx)!, referer: xxx
[timestamp] [:error] [pid 2727] ipa: INFO: [jsonserver_session] user#xxx: group_find(None, posix=True, version=u'2.230', no_members=True): SUCCESS
[timestamp] [:warn] [pid 2731] [client xxx] failed to set perms (3140) on file (/var/run/ipa/ccaches/user#xxx)!, referer: xxx
[timestamp] [:error] [pid 2726] ipa: INFO: [jsonserver_session] user#xxx: user_add(u'xxx', givenname=u'xxx', sn=u'xxx', userpassword=u'********', version=u'2.230'): DatabaseError
The user is not created but I have to remove the managed group as described here:
https://www.redhat.com/archives/freeipa-users/2016-August/msg00092.html before I can try again.
What is going on? Any help is appreciated.
$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
$ ipa --version
VERSION: 4.6.4, API_VERSION: 2.230
So I managed to solve the Problem.
While experimenting with other settings I tried to add the user without a private group and got the error message:
Server is unwilling to perform: Automember Plugin update unexpectedly failed.
A quick search showed, that error is happening, when the user is to be added to a group that does not exist, which happened due to an outdated Auto-Membership-Rule.
Correcting that, the user can be added.
when uploading files in the admin backend of SilverStripe, I always get permission denied.
The apache2 is running under www-data:www-data (checked with "whoami" and in the envvars).
The permissions for the assets folder are the following:
drwxrwxr-x+ 5 git www-data 4.0K Oct 2 08:18 .
drwxrwsr-x+ 17 git users 4.0K Oct 2 09:53 ..
-rwxrwxr-x+ 1 git www-data 1.5K Oct 2 08:18 .htaccess
drwxrwsr-x+ 2 git www-data 4.0K Oct 2 07:28 Uploads
drwxrwsr-x+ 2 git www-data 4.0K Oct 2 08:18 _combinedfiles
drwxrwsr-x+ 2 git www-data 4.0K Oct 2 07:57 books
-rwxrwxr-x+ 1 git www-data 4.5K Oct 1 14:48 error-404.html
-rwxrwxr-x+ 1 git www-data 4.3K Oct 1 14:48 error-500.html
-rwxrwxr-x+ 1 git www-data 4.4K Oct 2 08:18 web.config
Even if I set them to 777, I still get permission denied. It works locally and I can't get my head around why it doesnt work.
Apache ErrorLog:
[Fri Oct 02 10:24:18.364138 2015] [:error] [pid 16008] [client 62.218.34.90:44300] PHP Warning: copy(/var/www/X/assets/books/Mike.png): failed to open stream: Permission denied in /var/www/X/framework/filesystem/Upload.php on line 195, referer: http://x.amazonaws.com/index.php/admin/assets/add/?ID=7
[Fri Oct 02 10:24:18.364615 2015] [:error] [pid 16008] [client 62.218.34.90:44300] PHP Warning: Requirements_Backend::process_combined_files(): Couldn't create '/var/www/X/assets/_combinedfiles//lib.js' in /var/www/X/framework/view/Requirements.php on line 1214, referer: http://x.amazonaws.com/index.php/admin/assets/add/?ID=7
Is this an AWS specific problem? Any clues?
The problem were ACLs.
Using getfacl ./assets/ I could determine, that the ACLs were set to undermine the normal permission model.
With setfacl I was able to advance the ACLs to include the webuser (www-data) into the assets directory with rwx.
Hope this helps someone,
Best regards. G
I would recommend you use a module and store the assets in S3
https://github.com/markguinn/silverstripe-cloudassets
I'm using fail2ban. For some reason Fail2Ban refuse to compile my regex. Here is my logs that I need to match:
root#server1:/etc/fail2ban/filter.d# tail /var/log/apache2/error.log
[Sun Apr 20 10:40:05 2014] [error] [client 75.144.181.151] user root: authentication failure for "/phpmyadmin/": Password Mismatch
[Sun Apr 20 10:40:16 2014] [error] [client 75.144.181.151] user root: authentication failure for "/phpmyadmin/": Password Mismatch
[Sun Apr 20 10:40:38 2014] [error] [client 75.144.181.151] user haker not found: /phpmyadmin/
[Sun Apr 20 10:40:44 2014] [error] [client 75.144.181.151] user pentest not found: /phpmyadmin/
and here is my fail2ban filter.d file:
root#server1:/etc/fail2ban/filter.d# cat /etc/fail2ban/filter.d/phpmyadmin.conf
[Definition]
failregex = [client <HOST>;] user .*; not found: \/phpmyadmin\/|[client <HOST>;] user root: authentication failure for "\/phpmyadmin\/":
ignoreregex =
here is my regex line from the file above:
[client <HOST>;] user .*; not found: \/phpmyadmin\/|[client <HOST>;] user root: authentication failure for "\/phpmyadmin\/":
Unfortunately fail2ban log file giving me error about regex: Unable to compile regular expression..
root#server1:/etc/fail2ban# tail /var/log/fail2ban.log
2014-04-20 10:47:06,788 fail2ban.filter : INFO Added logfile = /var/log/apache2/error.log
2014-04-20 10:47:06,789 fail2ban.filter : INFO Set maxRetry = 3
2014-04-20 10:47:06,789 fail2ban.filter : INFO Set findtime = 600
2014-04-20 10:47:06,790 fail2ban.actions: INFO Set banTime = 600
2014-04-20 10:47:06,790 fail2ban.filter : ERROR Unable to compile regular expression '[client (?:::f{4,6}:)?(?P<host>[\w\-.^_]+);] user .*; not found: \/phpmyadmin\/|[client (?:::f{4,6}:)?(?P<host>[\w\-.^_]+);] user root: authentication failure for "\/phpmyadmin\/":'
2014-04-20 10:47:06,794 fail2ban.jail : INFO Jail 'ssh' started
2014-04-20 10:47:06,799 fail2ban.jail : INFO Jail 'pureftpd' started
2014-04-20 10:47:06,805 fail2ban.jail : INFO Jail 'phpmyadmin' started
My regex http://regex101.com/r/kU7tX3. What is wrong with this? Any help is appreciated. Thank you.
I would have asked a question in comment but i cannot add a comment:
So trying my best to understand the requirement and giving an answer.
Requirement: I think you are looking to filter all lines containing
"authentication failure for "/phpmyadmin/""
You can do so by changing your regular expression to following:
failregex = .*authentication failure for "\/phpmyadmin\/"
You may have to escape "
Please add comments if this wasn't the correct understanding.....
I can't seem to find the problem for the life of me. Very simply, I have a database object that I'm pulling from the database, incrementing it's "views" by one, and saving. My view display's the incremented value, but then my logs show that the value is incremented AGAIN.
g=Game.objects.filter(slug=slug).distinct()[0]
g.views += 1
g.save()
Here's my logs:
[Fri Oct 29 15:15:49 2010] [error] DEBUG:root:Updating plays
[Fri Oct 29 15:15:49 2010] [error] DEBUG:root:plays: 40
[Fri Oct 29 15:15:50 2010] [error] DEBUG:root:Updating plays
[Fri Oct 29 15:15:50 2010] [error] DEBUG:root:plays: 41
My view shows that it has 40 hits. This causes that my view increments by 2 every time I refresh:
[Fri Oct 29 15:20:19 2010] [error] DEBUG:root:Updating plays
[Fri Oct 29 15:20:19 2010] [error] DEBUG:root:plays: 42
[Fri Oct 29 15:20:19 2010] [error] DEBUG:root:Updating plays
[Fri Oct 29 15:20:19 2010] [error] DEBUG:root:plays: 43
Any hints as to what this could be?
EDIT:
Here's my view. I simplified it to the core elements (and it still behaves oddly).
def game(request, slug=None):
g=Game.objects.filter(slug=slug)[0]
if g:
comments=GameComment.objects.filter(item=g, parent__isnull=True)
g.plays+=1
g.save()
else:
comments=None
return render_to_response('goto/goto_game.html', {'g': g, 'comments':comments, 'cCount':len(comments) if comments else 0, 'newCCount':0}, request=request)
AH! Turns out it was a missing url and ajax issue. It wasn't the favicon, as that only hits the root, and not my specific view.
The problem came when I had an AJAX command like this:
$.post('{{url("_submitcomment")}}', data, function(data) { ...
and that 'url' could not reverse '_submitcomment' so returned an empty string. Calling
$.post('');
will hit your current URL and try to fetch everything!
(I'm using Jinja2, btw, so the url command probably looks different from them traditional Django template system.)
Thanks for the help and the tips!
In my case, each view was called twice, because my base template contained incorrect icon link in the <head> tag. It might look like this:
<link rel="icon" href="#">
So, after the page is loaded the browser sends a request to the current page again, which causes the second view call.
Remove the wrong <link> tag, and it should work.
Can you verify the second request is not for "/favicon.ico" ?