Created an features export of sapi server and index, and when reinstall my site, the feature appear overridden and reverting it does not create the appropriate sapi server and index settings. I'm using the latest dev version of search_api_solr (aa3887a) and search_api (cd0dcbc).
Comments
Comment #1
drunken monkeyDid you use the same version of Search API (and maybe other relevant modules) for creating the features as you are using now? Otherwise, if there were DB updates in between, the exports will of course be invalid now.
Otherwise I'll need more details on what goes wrong.
Comment #2
scor commentedI'm not sure what happened. I'm now able perform the revert successfully.
Just to clarify, is it normal that everytime I make a code change in features and want to deploy it, I need to run a feature revert? (views and context for example do not require a feature revert, but simply a cache clear). search_api does not support the concept of default, normal, and overridden for its servers and indexes?
Comment #3
drewish commentedYeah I don't think the revert actually works the way you'd expect it to. I just ran it and it delete the solr search indexes. I guess I was expecting it to be a little less destructive since I'd just done a features update it should have been exactly in sync.
Comment #4
drunken monkeyThe exportable system is based on the Entity API, so any questions or complaints should probably be directed there. I just implemented what was needed in the Search API and don't really understand the whole system myself.
If it turns out I'm doing something wrong, give me details and we can talk about it. But, as said, first check with Entity API whether they aren't by design.
Comment #5
luksakI am having a very similar issue. I also update my index and reverted it with features. Now I am getting this errer when trying to do run cron or delete a commerce product:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'staging.search_api_db_product_sku' doesn't exist: TRUNCATE {search_api_db_product_sku} ; Array ( ) in SearchApiDbService->deleteItems() (line 555 of /sites/all/modules/search_api_db/service.inc).So, is this a Entity API issue?
I don't have any pending DB updates.
Comment #6
chrisns commentedHey,
So the issue here is that when you do a features revert it reverts the index first and then the server, which breaks the index.
e.g:
drush fr -y --force myfeatureresults in broken search index
drush sapi-ihowever if I then follow that up with:
drush fr -y --force myfeature.search_api_indexI get a fixed search index! horrah!
drush sapi-ishort term until someone provides a more sensible fix you can either:
but beware that obviously next time you feature update it'll go back to alphabetical order
drush fr -y --force myfeature.search_api_indexafter every feature revertI can't see a way in features to reorder or mark dependencies or manipulate the order so this looks to be the best option of workarounds for now unless someone wants to change the search exportable stuff to name the two parts in a alphabetical order that works with the code.
That took quite a while to pick apart by the way :)
Cheers
Chris
Comment #7
drunken monkeyIs it possible that this was also fixed with #1414078-24: Revert of exportables not working?
Or, generally, that this is the same problem?
Comment #8
chrisns commentedIts fixed in that in terms of that its an alternative work around, but I'd argue that the solutions I proposed above are more valid since its a correct cycle to run the stuff to remove tables or anything else that a api_server has set to run on an uninstall that happens when doing a feature revert.
but yes it would appear to be an alternative take on the same problem
Comment #9
kenorb commentedComment #10
nikunjkotechaStill facing this issue and have found a perfectly working workaround.
Add install file for the feature and lock the server component
It is definitely a workaround and not a solution, but a working workaround.
Comment #11
damienmckennaAlso having problems with functionality disappearing and breaking that was exported using Features :-\
Comment #12
albionbrown commentedI'm having this issue too.
I've created a Search API server and index for nodes. Then, I exported them both to a feature and reset my site to test for a local deployment. The features get reverted in a fra --force -y and no errors appear, but the server and index still aren't created. Clearing caches doesn't work and I've checked the DB tables and they just don't exist. I'm using the Search API Database Search module for the service class. Any thoughts?
So far I've tried suggestions in #6 but none worked for me.
Modules:
Comment #13
albionbrown commentedI found a solution to the features revert not working for servers and indexes. I set up my server and index as per usual in the Search API, exported them to a feature and copied the generated configuration into a hook_install() function in my features' .install file. Now, when I reinstall the module, both the server and index are created and then I just need to revert features and the actual configuration required is reverted properly.
For example:
Comment #14
vasikeI had similar issue ... and i think the issue it was by using the same machine name for both index and server
Another issue it was by not renaming the server machine name in the index "definition" ....
I hope it helps somebody ... if it's the case