Comments (4)
Thanks for looking into it further, @GuySartorelli. I'm under the impression you did what you could and I would say that's more than enough here. You're doing great work lately, keep it up!
from silverstripe-fulltextsearch.
In SolrReindexImmediateHandler.php line 116, if I replace $process->run();
with $process->mustRun();
exposes the following error:
The command "'php /home/webspace/ss4-scratch/site/vendor/silverstripe/framework/cli-script.php dev/tasks/Solr_Reindex' 'index=
App\\Search\\SolrIndex
' 'class=SilverStripe\\CMS\\Model\\SiteTree
' 'group=0' 'groups=7' 'variantstate='''{"SilverStripe\\FullTextSearch\\Search\\Variants\\SearchVariantVersioned
":"Live"}'''' 'verbose=1'" failed. Exit Code: 127(Command not found) Working directory: /home/webspace/ss4-scratch/site/public Output: ================ Error Output: ================ sh: 1: exec: php /home/webspace/ss4-scratch/site/vendor/silverstripe/framework/cli-script.php dev/tasks/Solr_Reindex: not found
I think this is caused by retaining this line:
as a single string instead of including each component as a distinct value in the $cmd array
Making that change results in this error:
Class
App\\Search\\SolrIndex
does not exist in /home/webspace/ss4-scratch/site/vendor/silverstripe/framework/src/Core/Injector/InjectionCreator.php:17
And after not escaping the backslashes in the index class name we get:
SilverStripe\\CMS\\Model\\SiteTree
is not a subclass of DataObject
Finally, when we don't escape the backslashes in that class name either, we get the reindex working correctly.
I'll raise a PR for this momentarily, but putting this sequence here in case anyone wonders why the PR removes the backslash escaping.
from silverstripe-fulltextsearch.
Thanks for troubleshooting this!
Do you know/have you found what changed that this stopped working?
from silverstripe-fulltextsearch.
@michalkleiner In 3.9.0 a change was made to allow symfony/process ^4
, and part of the change included changing the command from being passed as a string to being passed as an array (see #301). Passing the string worked fine (with process 3.x) but it seems (and this is just based on the error output I was seeing) like there is some step if the command is passed as an array to confirm that the first item in the array is a valid executable.
Edit: Okay so there's nothing done to it prior to being executed... I can't really make heads of exactly why it ends up failing the way it does (the full array is ultimately implode
d and the resultant string, with some alterations, is passed to proc_open
)...
So I can't say why it's failing the way it is, just that it is and it didn't used to when it was passed as a string - and that splitting out that first array element into three distinct elements resolves it.
The escaping does make sense though, as both process 3 and 4 use implode(' ', array_map([$this, 'escapeArgument'], $commandline));
when imploding the command array, so we had been unintentionally double escaping the class names.
from silverstripe-fulltextsearch.
Related Issues (20)
- Is there a way of enforcing a sort? HOT 1
- Module shouldn't use file_get_contents to access external URLs HOT 3
- Module is utterly out of date HOT 4
- Filters are not escaped HOT 2
- Variant state not reset during processing. HOT 3
- Results not showing after editing pages (no soft-commit nor core reload issued) HOT 10
- Test and merge "allow update processor to be overridden by existing yml"
- Works fine on Dev, but on Prod many index files are missing and all owned by root (same database)
- Solr now at version 8 HOT 1
- Migrate to new Symfony cache classes HOT 5
- `SearchableService::isSearchable` incorrectly assumes return type of `canView` HOT 2
- Allowing Symfony 3.2 or 4 can break reindexing HOT 10
- Stage param not being passed to Symfony
- 4.11.0-beta1 PHP 8.1 - Deprecation issue in solr-php-client HOT 1
- 4.11.0-beta2 PHP 8.1 - Changes in content are not reflected in search results HOT 7
- SearchIndex::fieldData is inefficient
- RFC: Search index update/new searcher on auto commit HOT 10
- 4.12 regression: Elemental block content not showing on search summary HOT 8
- `SearchVariant` replaced by `Injector` not consistent when used as part of `_documentid` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silverstripe-fulltextsearch.