Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RC3] Cannot redeclare class OC_Search_Provider at /var/www/owncloud/lib/private/search/provider.php#5 #9726

Closed
enoch85 opened this issue Jul 18, 2014 · 24 comments

Comments

@enoch85
Copy link
Member

enoch85 commented Jul 18, 2014

Steps to reproduce

  1. Try to search in the Web UI

Expected behaviour

No error

Actual behaviour

Error PHP Cannot redeclare class OC_Search_Provider at /var/www/owncloud/lib/private/search/provider.php#5 Shows up in log.

Server configuration

Ubuntu Server 14.04

Database:
MySQL latest
PHP version:
PHP 5.5.9-1ubuntu4.3 (cli) (built: Jul 7 2014 16:36:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
ownCloud version: (see ownCloud admin page)
7.0 RC3
Updated from an older ownCloud or fresh install:
Fresh install

Are you using external storage, if yes which one: local/smb/sftp/...
No
Are you using encryption: yes/no
No

Client configuration

Browser:
Chrome Version 34.0.1847.131 m
Operating system:
Windows 8.1

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Just a bunch of these:
Error PHP Cannot redeclare class OC_Search_Provider at /var/www/owncloud/lib/private/search/provider.php#5


#### Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

@karlitschek
Copy link
Contributor

@butonic What do you think?

@butonic
Copy link
Member

butonic commented Jul 18, 2014

Maybe a duplicate of owncloud-archive/search_lucene#17. I am preparing a new version of search lucene. The stable7 branch has the ocsid already merged and I think @icewind1991 and have been polishing it for quite some time now. I only need to make sure it works with the latest patches to the session and user api in core/stable7. I then plan on releasing the new version via the appstore as soon as I get final testing done.

@enoch85 enoch85 added the RC3 label Jul 20, 2014
@MTRichards
Copy link
Contributor

Unable to reproduce on Debian variant with SQLite and oC 7.0.0 RC3. Running PHP 5.4.

@NightWorx
Copy link

adding a simple "x" in provider.php#5 (/lib/private/search/provider.php) solved the problem for me.
Of course: this is a weird & dirty fix, but hey, it works! ;)
old line #5: "abstract class OC_Search_Provider {"
fixed line #5: "abstract class OC_Search_Providerx {"

According to other posts, this is a conflict betwen OC & Zend
however, this should be fixed.

FreeBSD 9.2-RELEASE-p10, PHP 5.4.30, MySQL 5.5.37

@butonic
Copy link
Member

butonic commented Jul 24, 2014

I am currently moving the codebase to the composer autoloader. That should resolve class loading as @DeepDiver1975 already pointed out. The fix you posted will break ALL search providers, and will give you class not found exceptions whenever using the search. No matter if search_lucene is involved or not, because all search results are derived from OC_Search_Provider.

I'll post an update when a version with composer is available.

@enoch85 enoch85 removed the RC3 label Jul 24, 2014
@NightWorx
Copy link

true...true...
but in My situation, I prefer to have a working login instead of a working search engine (although its still working...?).
However: the described fix was never meant to be a proper solution. To me it was just a dirty workaround that allowed me to still log in - nothing more.

@marfig2005
Copy link

Hi, I have same problem, I had OC6 where search was working and today I upgraded to OC7 and search stopped work

@merlin2004
Copy link

The same problem here after upgrade to OC 7 stable.

@TechCare-Aus
Copy link

Same problem here

@DeepDiver1975 DeepDiver1975 added this to the ownCloud 7.0.1 milestone Jul 29, 2014
@butonic
Copy link
Member

butonic commented Jul 29, 2014

@SilFoiera @marfig2005 @merlin2004 @sjswarts85 How exactly did you update?

I am asking because the release tarball does not contain a /lib/private/search/provider.php. Could it be that you did not move away the old owncloud code as described in http://doc.owncloud.org/server/7.0/admin_manual/maintenance/update.html#upgrading-the-owncloud-server:

@DeepDiver1975 @karlitschek now that I am reading the docs, simply overwriting the old code and not extracting into an empty directory is not supported as an upgrade path. The documentation is clearly wrong there. Otherwise loft over classes, as in this case will be picked up twice by the autoloader.

For anyone who has run into this problem: simply delete /lib/private/search/provider.php It is a leftover from the old owncloud installation.

For completeness sake: I misinterpreted this issue with loading zend classes because they might have been installed system wide.

@TechCare-Aus
Copy link

@butonic G'day mate, I cheat a little and maybe it is the packager's issue. I use cPanel hosting with Installatron. When I updated through the Web interface I was greeted with that error.

Googling it led me here, so if you think its a problem with the package maintainer I will contact them directly and post back.

@oparoz
Copy link
Contributor

oparoz commented Jul 29, 2014

@sjswarts85 Please open a ticket with Installatron so that they update their upgrade procedure :)

@TechCare-Aus
Copy link

@oparoz ok will do

@butonic butonic self-assigned this Aug 1, 2014
@merlin2004
Copy link

@butonic:
I also removed the old /lib/private/search/result.php.
Otherwise you will get this error:
"Cannot redeclare class OC_Search_Result at ....../private/search/result.php"

@butonic
Copy link
Member

butonic commented Aug 4, 2014

I updated the documentation accordingly. Have a look at owncloud-archive/documentation#464 and give a quick 👍 If you think it makes sense.

@butonic
Copy link
Member

butonic commented Aug 4, 2014

The documentation has been fixed accordingly, closing this.

@butonic butonic closed this as completed Aug 4, 2014
@butonic butonic added v7.x and removed 5 - To review labels Aug 4, 2014
@oparoz
Copy link
Contributor

oparoz commented Aug 4, 2014

👍

@enoch85
Copy link
Member Author

enoch85 commented Aug 16, 2014

@butonic This was a fresh install though...

@butonic
Copy link
Member

butonic commented Sep 1, 2014

@enoch85 The release tarball does not contain a /lib/private/search/provider.php. Could you check that you don't have that file? How did you install? With the release tarball or via a distro package?

You can just delete /lib/private/search/provider.php. Although I recommend updating to the latest stable7.

@enoch85
Copy link
Member Author

enoch85 commented Sep 1, 2014

@butonic No, I don´t have provider.php anymore. But I don´t remember if I took it away manually more than 2 weeks ago.

I always install via package.

Anyway, now I get this instead:


Error   search_lucene   Encrypted document modification is not supported Trace:\n#0 /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Pdf.php(255): Zend_Pdf->__construct('%PDF-1.4?%?????...', NULL) #1 /var/www/owncloud/apps/search_lucene/document/Pdf.php(21): Zend_Pdf::parse('%PDF-1.4?%?????...') #2 /var/www/owncloud/apps/search_lucene/document/Pdf.php(69): OCA\Search_Lucene\Document\Pdf->__construct('%PDF-1.4?%?????...', false, false) #3 /var/www/owncloud/apps/search_lucene/lib/indexer.php(94): OCA\Search_Lucene\Document\Pdf::loadPdf('%PDF-1.4?%?????...') #4 /var/www/owncloud/apps/search_lucene/ajax/lucene.php(44): OCA\Search_Lucene\Indexer::indexFile('/??vrigt/Teleno...', 'enoch') #5 /var/www/owncloud/apps/search_lucene/ajax/lucene.php(76): index() #6 /var/www/owncloud/lib/base.php(797): require_once('/var/www/ownclo...') #7 [internal function]: OC::loadAppScriptFile(Array) #8 /var/www/owncloud/lib/private/route/router.php(227): call_user_func(Array, Array) #9 /var/www/owncloud/lib/base.php(697): OC\Route\Router->match('/apps/search_lu...') #10 /var/www/owncloud/index.php(28): OC::handleRequest() #11 {main} 2014-09-01T12:05:24+00:00
Error   search_lucene   Cross-reference streams are not supported yet. Trace:\n#0 /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Pdf/Parser.php(460): Zend_Pdf_Parser->_loadXRefTable('116') #1 /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Pdf.php(318): Zend_Pdf_Parser->__construct('%PDF-1.5?%?????...', Object(Zend_Pdf_ElementFactory_Proxy), false) #2 /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Pdf.php(255): Zend_Pdf->__construct('%PDF-1.5?%?????...', NULL) #3 /var/www/owncloud/apps/search_lucene/document/Pdf.php(21): Zend_Pdf::parse('%PDF-1.5?%?????...') #4 /var/www/owncloud/apps/search_lucene/document/Pdf.php(69): OCA\Search_Lucene\Document\Pdf->__construct('%PDF-1.5?%?????...', false, false) #5 /var/www/owncloud/apps/search_lucene/lib/indexer.php(94): OCA\Search_Lucene\Document\Pdf::loadPdf('%PDF-1.5?%?????...') #6 /var/www/owncloud/apps/search_lucene/ajax/lucene.php(44): OCA\Search_Lucene\Indexer::indexFile('/??vrigt/Skadea...', 'enoch') #7 /var/www/owncloud/apps/search_lucene/ajax/lucene.php(76): index() #8 /var/www/owncloud/lib/base.php(797): require_once('/var/www/ownclo...') #9 [internal function]: OC::loadAppScriptFile(Array) #10 /var/www/owncloud/lib/private/route/router.php(227): call_user_func(Array, Array) #11 /var/www/owncloud/lib/base.php(697): OC\Route\Router->match('/apps/search_lu...') #12 /var/www/owncloud/index.php(28): OC::handleRequest() #13 {main}  2014-09-01T12:05:24+00:00
Error   search_lucene   Encrypted document modification is not supported Trace:\n#0 /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Pdf.php(255): Zend_Pdf->__construct('%PDF-1.4?%?????...', NULL) #1 /var/www/owncloud/apps/search_lucene/document/Pdf.php(21): Zend_Pdf::parse('%PDF-1.4?%?????...') #2 /var/www/owncloud/apps/search_lucene/document/Pdf.php(69): OCA\Search_Lucene\Document\Pdf->__construct('%PDF-1.4?%?????...', false, false) #3 /var/www/owncloud/apps/search_lucene/lib/indexer.php(94): OCA\Search_Lucene\Document\Pdf::loadPdf('%PDF-1.4?%?????...') #4 /var/www/owncloud/apps/search_lucene/ajax/lucene.php(44): OCA\Search_Lucene\Indexer::indexFile('/??vrigt/F??rs?...', 'enoch') #5 /var/www/owncloud/apps/search_lucene/ajax/lucene.php(76): index() #6 /var/www/owncloud/lib/base.php(797): require_once('/var/www/ownclo...') #7 [internal function]: OC::loadAppScriptFile(Array) #8 /var/www/owncloud/lib/private/route/router.php(227): call_user_func(Array, Array) #9 /var/www/owncloud/lib/base.php(697): OC\Route\Router->match('/apps/search_lu...') #10 /var/www/owncloud/index.php(28): OC::handleRequest() #11 {main} 2014-09-01T12:05:23+00:00
Error   PHP iconv(): Detected an illegal character in input string at /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum.php#58  2014-09-01T12:05:22+00:00
Error   PHP iconv(): Detected an illegal character in input string at /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum.php#58  2014-09-01T12:05:22+00:00
Error   PHP iconv(): Detected an illegal character in input string at /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum.php#58  2014-09-01T12:05:22+00:00
Error   search_lucene   Encrypted document modification is not supported Trace:\n#0 /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Pdf.php(255): Zend_Pdf->__construct('%PDF-1.6?%?????...', NULL) #1 /var/www/owncloud/apps/search_lucene/document/Pdf.php(21): Zend_Pdf::parse('%PDF-1.6?%?????...') #2 /var/www/owncloud/apps/search_lucene/document/Pdf.php(69): OCA\Search_Lucene\Document\Pdf->__construct('%PDF-1.6?%?????...', false, false) #3 /var/www/owncloud/apps/search_lucene/lib/indexer.php(94): OCA\Search_Lucene\Document\Pdf::loadPdf('%PDF-1.6?%?????...') #4 /var/www/owncloud/apps/search_lucene/ajax/lucene.php(44): OCA\Search_Lucene\Indexer::indexFile('/??vrigt/Filh??...', 'enoch') #5 /var/www/owncloud/apps/search_lucene/ajax/lucene.php(76): index() #6 /var/www/owncloud/lib/base.php(797): require_once('/var/www/ownclo...') #7 [internal function]: OC::loadAppScriptFile(Array) #8 /var/www/owncloud/lib/private/route/router.php(227): call_user_func(Array, Array) #9 /var/www/owncloud/lib/base.php(697): OC\Route\Router->match('/apps/search_lu...') #10 /var/www/owncloud/index.php(28): OC::handleRequest() #11 {main} 2014-09-01T12:05:21+00:00
Error   PHP iconv(): Detected an illegal character in input string at /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum.php#58  2014-09-01T12:05:20+00:00

(And now I have 7.0.1)

@enoch85
Copy link
Member Author

enoch85 commented Nov 2, 2014

@butonic PING

@enoch85 enoch85 reopened this Nov 2, 2014
@MorrisJobke MorrisJobke modified the milestones: 2014-sprint-08-current, 2014-sprint-01 Nov 15, 2014
@FreeMinded
Copy link

Removing the two left over files mentioned here did the job for me!
/lib/private/search/result.php
/lib/private/search/provider.php

Thanks!

@butonic
Copy link
Member

butonic commented Nov 19, 2014

@enoch85 please stay on topic of the original issue. Encrypted document modification is not supported tells me that an encrypted PDF is used. We have no way of indexing them, but I agree that that should not have the level ERROR. Could you try with search_lucene master and open an issue in that repository if the problem still exists?

@butonic butonic closed this as completed Nov 19, 2014
@ace02000
Copy link

ace02000 commented Feb 9, 2015

great! Thank you for this solution.
This worked for me.

remove ...
owncloud/lib/private/search/result.php
owncloud/lib/private/search/provider.php

@lock lock bot locked as resolved and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests