isohuntto / openbay

Other
3.52k stars 902 forks source link

Browse not working, #2

Open dynamitedj opened 9 years ago

dynamitedj commented 9 years ago

I've got the site and everything up and running however, when i click to search or even Browse torrents i just get a shit happens error message, any ideas what could have gone wrong? i've re-installed several times but still getting the same problem. capture

isohuntto commented 9 years ago

Hey,

Looks like there is an error with .htaccess Can you try another hosting or configure apache?

Yours truly,

Isohunt.to team.

Join us on facebook https://www.facebook.com/isohuntto, twitter https://twitter.com/Isohuntto, Isohunt.to forum http://forum.isohunt.to/ !

On Fri, Dec 19, 2014 at 11:18 PM, dynamitedj notifications@github.com wrote:

I've got the site and everything up and running however, when i click to search or even Browse torrents i just get a shit happens error message, any ideas what could have gone wrong? i've re-installed several times but still getting the same problem. [image: capture] https://cloud.githubusercontent.com/assets/10245756/5508294/1569e01c-87a3-11e4-8433-4643f270207b.JPG

— Reply to this email directly or view it on GitHub https://github.com/isohuntto/openbay/issues/2.

dynamitedj commented 9 years ago

I'm the Root account for the cpanel server so its no issue looking at the Apache, but i've checked htaccess and i cannot find anything relating to /browse, there is also no browse folder for /src/www/ where it is trying to find, should it not be trying to call the browse from your database server instead of mine?

i can try alternative hosting however the secondary server does not have PDO/PDO-MYSQL instaled as it is for Dev Testing of Web Scripts.

GreySyntax commented 9 years ago

Try enabling the debug flag in protected/config/debug.php and see if you get any more info.

dynamitedj commented 9 years ago

I have bolded the Red Lines from the debug page, if you want the Direct Link i can provide that @GreySyntax


PHP notice

Array to string conversion

/home/dynamite/public_html/proxy/src/protected/models/LTorrent.php(423)

411 ->option('ranker', 'SPH04') 412 ->search('@tags "' . $obj->halfEscapeMatch($tag) . '"') 413 ->where('torrent_status', LTorrent::TORRENT_STATUS_GOOD) 414 ->order('weight()', 'DESC') 415 ->order('id', 'DESC') 416 ->limit($count); 417 418 $torrentsIds = array_merge($torrentsIds, Yii::app()->sphinx->cache(600)->createCommand($obj->build())->queryColumn()); 419 } 420 Yii::app()->cache->set($key, $torrentsIds); 421 } 422 } catch (Exception $e) { 423 Yii::log('getLastTorrentIdsByCategories failed. Exception: ' . $e->getMessage() . PHP_EOL . 'Trace: ' . $e->getTrace(), CLogger::LEVEL_ERROR); 424 425 if (YII_DEBUG) { 426 throw $e; 427 } 428 } 429 430 return $torrentsIds; 431 } 432 433 public function getBBParsed($str = null) 434 { 435 if ($str === null) { Stack Trace

0

– /home/dynamite/public_html/proxy/src/protected/controllers/MainController.php(257): LTorrent::getLastTorrentIdsByCategories() 252 public function actionCategories() 253 { 254 $this->pageTitle = 'Browse Torrents | ' . Yii::app()->name . ' Torrent Search Engine'; 255 256 $torrentsByTags = array(); 257 $torrentsIds = LTorrent::getLastTorrentIdsByCategories(); 258 259 if (empty($torrentsIds)) { 260 Yii::log('Empty last torrents ids', CLogger::LEVEL_WARNING); 261 } else { 262 $torrentModel = LTorrent::model();

1

– /home/dynamite/public_html/proxy/src/protected/controllers/MainController.php(102): MainController->actionCategories() 097 { 098 if ($q || $iht) { 099 return $this->actionSearch($q, $iht, $status); 100 } 101 102 return $this->actionCategories(); 103 } 104 105 protected function checkSearchRequest() { 106 $uri = Yii::app()->getRequest()->getRequestUri(); 107 if (preg_match('#ihq=([^&]+)#', $uri, $matches)) {

2

unknown(0): MainController->actionBrowse(null, null, 0)

3

GreySyntax commented 9 years ago

Looks like your sphinx config is incorrect, check the searchd listen section is correct

isohuntto commented 9 years ago

@dynamitedj was the issue fixed by recent commits?

dynamitedj commented 9 years ago

i'm waiting to find out, i've logged out of my server for now but will update tomorrow and let you know as i've been up 40 hours and i'm flagging so not with it, don't want to risk completely messing it up.

dynamitedj commented 9 years ago

Nope, i can only assume that with my server not having Sphinx installed and trying to use your Sphinx from the installer so i didn't have to fight with Cpanel.

image

dynamitedj commented 9 years ago

i'll have to install Sphinx and try to get it working with CPanel

FREEZX commented 9 years ago

I have the same issue. My hosting does not have sphinx, and i'm unable to browse and search.

GreySyntax commented 9 years ago

After getting sphinx to behave, the browse and search pages have started working for me. I think this may actually be a non-issue

FREEZX commented 9 years ago

The issue could be with the provided sphinx config.

NewEraCracker commented 9 years ago

I would be great if they had some sort of mechanism that allowed falling back to MySQL. It shouldn't be hard to add an index to 'name' column and use it to search when Sphinx is not available.

This would put the script working, even in hosts without Sphinx.

dynamitedj commented 9 years ago

I've installed Sphinx but its still failing for me, wondering if it is a problem with Config now, i've manually changed to my Sphinx instead of the default Sphinx and still getting the same thing, wondering now...

YasarChavez commented 9 years ago

http://openbay.com.nu/ GOOD!

dynamitedj commented 9 years ago

@tuneniitoo what Sphinx are you running? are you running your own or are you running the default config? i'm on a dedicated server with full root access i have Sphinx installed locally and it is still not working as it should be

dynamitedj commented 9 years ago

Ok, so i've got Sphinx somewhat working, but now i'm getting errors galore, please remember this is a CPANEL server, i've altered the conf slighly to listen on 3312 and 3307:mysql41 now when i click browse i instantly get the 404 error rather than a delay, i'm also getting warnings and a fatal error on sphinx boot.

---- QUOTE --- 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 '/root/local/etc/sphinx.conf'... WARNING: key 'charset_type' was permanently removed from Sphinx configuration. Refer to documentation for details. WARNING: key 'enable_star' was permanently removed from Sphinx configuration. Refer to documentation for details. WARNING: key 'max_matches' was permanently removed from Sphinx configuration. Refer to documentation for details. WARNING: preopen_indexes=1 has no effect with seamless_rotate=0 listening on all interfaces, port=3312 listening on all interfaces, port=3307 WARNING: index 'opb_common': key 'path' not found - NOT SERVING precaching index 'opbtorrents' WARNING: index 'opbtorrents': preload: failed to open /var/lib/sphinx/opbtorrents2.sph: No such file or directory; NOT SERVING FATAL: no valid indexes to serve

---- END QUOTE ----

Any ideas?

FREEZX commented 9 years ago

http://stackoverflow.com/questions/20010439/sphinx-search-error-not-indexing

dynamitedj commented 9 years ago

Tried that but i'm using the Conf that was in the download, unless i've missed something else.... any other ideas?

src386 commented 9 years ago

Hi, same for me, 404 everywhere except for the "Recent torrents". I get the feeling that the "official" sphinx.conf is problematic, at least for debian. I finally managed to run it, here are the steps : 1) edit /etc/sphinxsearch/sphinx.conf and paste the example configuration 2) In the source opb_dbconnect { section set your mysql parameters 3) In the index opb_common { section add the following lines :

source = opbtorrents
path = /var/lib/sphinxsearch/data/opb_common

4) In the index opbtorrents : opb_common { section add the following lines :

source = opbtorrents
path = /var/lib/sphinxsearch/data/opbtorrents2

5) In the searchd { section, add/modify these :

listen = 9312
listen = 9306:mysql41
log = /var/log/sphinxsearch/searchd.log
query_log = /var/log/sphinxsearch/query.log
pid_file = /var/run/sphinxsearch/searchd.pid
binlog_path = /var/lib/sphinxsearch/data

6) Execute these commands :

indexer -c /etc/sphinxsearch/sphinx.conf opb_common
indexer -c /etc/sphinxsearch/sphinx.conf opbtorrents

7) Run sphinxsearch !

service sphinxsearch start

Sphinx seems to be working now, but I'm still getting 404 errors ....

src386 commented 9 years ago

On openbay/src/protected/runtime/application.log I get that strange error :

SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

This is not normal. I don't use the root account for mysql. Here is my config.php :

'connectionString' => 'mysql:host=localhost;port=3306;dbname=dbopenbay',
        'username' => 'openbay',
        'password' => 'MYSECRETPASSWORD!',
        'schemaCachingDuration' => '86400',
        'charset' => 'utf8',
        'enableProfiling' => true

Is it a bug ?

booth-f commented 9 years ago

I followed all the instructions and such but I still cant get the search to work, just try to search on there and you'll see what I mean http://xalogen.koding.io/

src386 commented 9 years ago

Is there a way to get openbay working ? I'm stuck on this 404 error. No documentation, no help, no log...

booth-f commented 9 years ago

@src386 Just turn debug mode on in protected/config and then try browsing again. That should give you an error to work from.

src386 commented 9 years ago

Thanks. This is what I get : CDbConnection failed to open the DB connection: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

Yeah because I DON'T WANT TO USE ROOT ! And my config.php says 'username' => 'openbay', Looks like openbay doesn't care about config.php...

hutchy1990 commented 9 years ago

This is the error I am getting :-1:

DbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 unknown local index 'opbtorrents' in search request. The SQL statement executed was: SELECT count(*) FROM opbtorrents ORDER BY weight() DESC, id DESC LIMIT 0, 20

no1453 commented 9 years ago

Just wanted to make the comment that if the example-sphinx.conf file is using 3306, then you can basically assume it's f-ed up. Mysql uses 3306. That number should definitely be 9306, for a default configuration. (EDIT: I might be wrong, still researching.) I'm struggling through the same issues.

@src386- Apparently on debian mysql defaults to not allowing web access. You have to enable it, and then give permissions to the connecting user (root or whoever you choose to use.)

see https://rtcamp.com/tutorials/mysql/remote-access/

@GreySyntax- Would you mind posting the sphinx.conf you used that seems to be working?

aaruni96 commented 9 years ago

Browse giving me this error.

CDbCommand failed to execute the SQL statement: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected. The SQL statement executed was: SELECT id FROM opbtorrents WHERE MATCH('@tags \"Anime\"') AND torrent_status = 1 ORDER BY weight() DESC, id DESC LIMIT 0, 5 OPTION ranker=SPH04

no1453 commented 9 years ago

@aaruni96 -- have you run "indexer --all" and "service sphinxsearch restart"? It looks like it can't find those databases (opbtorrent), which are created when you run "indexer --all".

EDIT: you also might want to check that you are consistently using the same name for your database, entered in the wizard, The same name should be in /etc/sphinxsearch/sphinx.conf. And you did create a database with that name in mysql before running the wizard?

no1453 commented 9 years ago

Thanks to the info about turning on debug messages, I now have an error to work from.

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers

src386 commented 9 years ago

@no1453 : Thanks, but everything is local, there is not remote access.

aaruni96 commented 9 years ago

@no1453 : The recent section reads from my database. The browse section doesn't.

And I'm using MariaDB. SphinxSE is bundled into MariaDB and all I did was activate SphinxSE. I did nothing else, because I didn't know anything else was required.

My database name is "torrents". I have no idea why the sql query is for "opbtorrent". The code must be bugged. Or "opbtorrent" must be a virtual database or something.

no1453 commented 9 years ago

Yes, opbtorrent is created from your database when it's indexed. Not sure how SphinxSE does that. I'm getting the same behavior with "browse" and "recent".

You might try running "indexer --all" (if it exists in your path). I got useful info from the output.

no1453 commented 9 years ago

@src386- If you're using "localhost" for the server address, you still might need to grant access, it's a loopback address, but it still acts like a remote connection, I believe. I got the same error you posted until I enabled remote access and granted access to my user. If you want to keep everything local, I believe you can enable access for only 127.0.0.1 as the IP. The link I posted has steps for that, I think (for granting access only to a certain ip.)

src386 commented 9 years ago

@ no1453 : it does not work because the root user is not allowed and it's normal. I created a user "openbay" with all rights on "dbopenbay". I don't understand why openbay wants the root user.

hutchy1990 commented 9 years ago

Anyone have any idea about this error it's doing my head in

DbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 unknown local index 'opbtorrents' in search request. The SQL statement executed was: SELECT count(*) FROM opbtorrents ORDER BY weight() DESC, id DESC LIMIT 0, 20

no1453 commented 9 years ago

@hutchy1990 - If the opbtorrents index is missing, I think it means you need to run "indexer --all" (as root). That will create the opbtorrents index (from your specified database).

no1453 commented 9 years ago

Surprisingly, after about 20 hours of work, I have openbay working, using my own sphinx and local database. So if anyone wants to ask questions about my config, fire away. Two points; I had to compile the newest version of sphinxsearch, and I had to remove the line " charset = utf-8" from /src/protected/config/config.php. (That isn't the exact line, but it's pretty much what it looked like)

src386 commented 9 years ago

@no1453 : I admit I'm jealous :) congratuilations. I'm using sphinx 2.2.1 (freebsd ports) and I commented the utf8 in config.php but I'm stuck on a SQL syntax error. Could you post your config.php please ? at least these two sections : 'db' => array( and 'sphinx' => array(

no1453 commented 9 years ago

Here's the whole thing.


<?php

return array(
    'name' => 'NeoPirate',
    'theme' => 'oldpiratebay',
        'preload' => array('log'),
        'import' => array(
        'application.helpers.*',
    ),
    'basePath' => __DIR__ . DIRECTORY_SEPARATOR . '..',
    'language' => 'en',
    'sourceLanguage' => 'en',
    'import' => array(
        'application.components.*',
        'application.models.*',
      'ext.ESphinxQL.*'
    ),
    'components' => array(
        'db' => array(
            'connectionString' => 'mysql:host=MY_IP_FILL_IN_YOURS;port=17666;dbname=tordb',
            'username' => 'root',
            'password' => 'xxxxxxxx',
            'schemaCachingDuration' => '86400',
            'charset' => 'utf8',
            'enableProfiling' => true
        ),
        'cache' => array(
            'class' => 'system.caching.CFileCache',
        ),
        'sphinx' => array(
            'class' => 'system.db.CDbConnection',
            'connectionString' => 'mysql:host=MY_IP_FILL_IN_YOURS;port=9306',
            'queryCacheID' => 'cache'
        ),
        'request' => array(
            'class' => 'application.components.AHttpRequest'
        ),
        'clientScript' => array(
            'scriptMap' => array(
                'jquery.min.js' => '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js',
            ),
            'packages' => array(
                'base' => array(
                    'baseUrl' => '/css/',
                    'css' => array(
                        'opb.css',
                   ),
                ),
            ),
        ),
        'urlManager' => array(
            'urlFormat' => 'path',
            'showScriptName' => false,
            'caseSensitive' => false,
            'rules' => require(__DIR__ . '/rules.php')
        ),
        'errorHandler' => array(
            'errorAction' => 'main/error'
        ),
                'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, warning'
                )
            )
        ),
                'session' => array(
            'sessionName' => 'MYSESSIONID'
        ),
        'format' => array(
            'class' => 'application.components.Formatter'
        ),
    ),
    'params' => array(
        'adminEmail' => 'isohunt.to@gmail.com',
        'sphinx' => array(
            'indexes' => array(
                'torrents' => 'opbtorrents',
            ),
        ),
    ),
);
no1453 commented 9 years ago

A note about the above, I have mysql using port 17666, and sphinxsearch on 9306

Edit: somehow the charset = utf8 line snuck back in there, but it still works.

src386 commented 9 years ago

I changed "localhost" to "127.0.0.1" in my config.php and remove some lines previously added by me. No error this time but 0 resultats, I think I broke my sphinx indexes. I try to repair this. If I can make it work, I'll write a wiki page for FreeBSD and Debian installation... EDIT : It works !

hutchy1990 commented 9 years ago

@no1453 I have ran indexer --all and it ran smooth opbtorrent was created maybe it's to do with I have sphinx installed on root and my website is a normal account created in cpanel

compsjp commented 9 years ago

i am also just getting 404 on any links. trying use everything default., web server is small. wont be able to do a own spinx. why is default broken?

src386 commented 9 years ago

The documentation has flaws :

It took days for me but now it works with FreeBSD. I'm currently writing a wiki page. I'll see if I can make something for a debian/ubuntu host.

compsjp commented 9 years ago

yea..... i got it working!!!!!!

no1453 commented 9 years ago

I used the csv from isohnt.to/open bay, had to break it into chunks to import because more than one hash was 0 (when they have to be unique, or else import fails.) The third chunk of 1 million lines seems to be the one it doesn't like, chunks 1,2,&4 imported fine, and now i'm trying the last 3.8 million line chunk. I'll probably have to edit the 3rd chunk in Excel to find and remove any lines with hash 0 (Excel can only open a little more than a million entries.) A bit of work, but i've learned a lot in doing it. So if your import is failing like mine did, at least here's some idea where to look for the problem.

compsjp commented 9 years ago

i am on ubuntu 12.04 and honestly it was all cause of i had to custom up .htaccess, and apache to allow

ghost commented 9 years ago

Hello, I tried to make it work as src386 said in his instruction, but when I'm executing indexer -c /etc/sphinxsearch/sphinx.conf opb_common

I'm getting errors:

Sphinx 2.0.4-id64-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'...
WARNING: key 'path' is not multi-value; value in /etc/sphinxsearch/sphinx.conf line 57 will be ignored.
WARNING: key 'log' is not multi-value; value in /etc/sphinxsearch/sphinx.conf line 77 will be ignored.
WARNING: key 'pid_file' is not multi-value; value in /etc/sphinxsearch/sphinx.conf line 79 will be ignored.
WARNING: key 'binlog_path' is not multi-value; value in /etc/sphinxsearch/sphinx.conf line 80 will be ignored.
indexing index 'opb_common'...
FATAL: out of memory (unable to allocate 436994064 bytes)

Why is that? My system is Ubuntu 14.04 x64, I installed Sphinx by official guide (http://sphinxsearch.com/docs/latest/installing-debian.html). I'm having only 512mb memory. Am I really need more to make it work? Can I make this index on my PC and load it on server? Will it need that much memory every little update?

src386 commented 9 years ago

I'm not familiar with Sphinx but you could try to allow more RAM in :

indexer {
mem_limit = 32M