RSolr::Error::Http - 404 Not Found - solr

I got the following error when i tried to run "rake sunspot:solr:reindex". Does anyone has idea how to fix this? It used to be running fine until recently.
RSolr::Error::Http - 404 Not Found
Error: Not Found
Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><delete><query>type:Place</query></delete>"
Backtrace: /usr/local/rvm/gems/ruby-2.0.0-p247/gems/rsolr-1.0.9/lib/rsolr/client.rb:268:in `adapt_response'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/rsolr-1.0.9/lib/rsolr/client.rb:175:in `execute'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/rsolr-1.0.9/lib/rsolr/client.rb:161:in `send_and_receive'
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems/sunspot-d013ad3c9f86/sunspot_rails/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/notifications.rb:159:in `block in instrument'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/notifications.rb:159:in `instrument'
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems/sunspot-d013ad3c9f86/sunspot_rails/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'
Full error code at https://gist.github.com/DerekChia/36ebe381451b2c4cf18d

I am new to solr and had the same issue getting it working in development. When I ran everything as sudo, it started up with no problems:
$ sudo bundle exec rake sunspot:solr:start
$ sudo bundle exec rake sunspot:solr:reindex
I could then view the solr server at http://localhost:8982/solr
So it looks like a permissions issue to avoid having to run it as root.

Related

Installing compass or FFI not working

I've tried installing compass and ffi on osx but get the same error.
I've reconfigured and reinstalled ruby, I've installed Xcode command line tools, I've rebooted my machine, nothing seems to fix the exact same error every single time. I'm about to wipe my machine and start anew, I have no idea why I can't get past this error when trying gem install compass:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20160508-18749-v694wb.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `block in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:502:in `with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1038:in `block in have_header'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:889:in `block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:888:in `checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1037:in `have_header'
from extconf.rb:16:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/ffi-1.9.10/mkmf.log
extconf failed, exit code 1

Solr: 404 error with getting admin page

I've installed Solr on my Ubuntu to this path
/opt/solr/solr-4.10.2
After installing I started Solr:
sudo bin/solr start from /opt/solr/solr-4.10.2 directory
As I can understand it started successfully
Waiting to see Solr listening on port 8983 [/]
Started Solr server on port 8983 (pid=8385). Happy searching!
But when I try to get to admin page
http://localhost:8983/solr
I got 404 error:
HTTP ERROR: 404
Problem accessing /solr. Reason:
Not Found
Powered by Jetty://
Do you have any suggestion what's going wrong and where to look in order to fix this problem?
Since this error can be caused by a lot of things, you need to access the log file and debug the execution.
First of all, open your Node log file, located in /opt/solr/solr-4.10.2/node1/log and look for something weird (Shift+F for Errors).
Generally, this error occurs when you have a mismatch between the Solr required Java JDK and your current Java JDK.
When I had this problem, I found in the log file the following error message java.lang.UnsupportedClassVersionError: org/apache/solr/servlet/SolrDispatchFilter : Unsupported major.minor version 51.0 and realized the problem was the java version.
To solve this, try to change the current JDK, using the command sudo update-alternatives --config javac.
If the error still occurs, try to uninstall all unused JDK's, because Solr is getting the wrong path.
The final solution to this issue is to open the file /opt/solr/solr-4.10.2/solar.in.sh and edit the SOLR_JAVA_HOME, writing the right JDK path (e.g /usr/lib/jvm/java-1.7.0)
Disclosure: the secret is look in the log file and figure out what is causing the issue.
Cheers.
try:
http://localhost:8983/solr/index.html
[solr's web.xml]
<servlet>
<servlet-name>LoadAdminUI</servlet-name>
<servlet-class>org.apache.solr.servlet.LoadAdminUiServlet</servlet-class>

Vagrant Error, The box failed to unpackage properly

I have a question for help that I could not find on any of these topics already.
I am trying to implement vagrant against my pre-existing virtual box. Most of the topics online right now are referring to using a box from vagrant cloud, or building one from scratch etc. My issue is I have an already built virtual box using Virtualbox as the provider specifically 1.4.3 as the version. The box is 124GB so remaking it is not exactly ideal. I have the vagrant config file set to locate the virtual box at path /users/desktop/foldername/filename.vbox. Every time it tries to add the box I get the error
"The box failed to unpackage properly. Please verify that the box file you're trying to add is not corrupted and try again. The output from attemtping to unpackage (if any):
Bsdtar: Error opening archive: Unrecognized archive format."
My knowledge is that this is because Vagrant is looking to add a .tar file and the file is not a tar extension.
Your supposed to be able to configure vagrant file to recognize the provider which I have done as well. Mine is set to
config.vm.provider "virtualbox" do |vb|
vb.gui = true
end
But no matter what I try I'm always getting the error above.
One thing to note is I'm not sure how to go about providing the metadata.json file, or how I can find that to edit it. Perhaps that is my problem? I have the latest version of vagrant so that is not the issue.
Any assistance would be greatly appreciated.
I have tried the vagrant package and below is my error I'm getting Please see if you may be able to provide further assistance.
I tried what you have suggested and here is the error message that I'm getting. I greatly appreciate your help.
nokeys$ vagrant package --base Dev_Clonea --output /users/nokeys/desktop/Dev_Clone/Dev_Clone.vbox
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:306:in `id=': undefined method `children' for nil:NilClass (NoMethodError)
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:438:in `state'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/action/created.rb:11:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/call.rb:43:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:196:in `action_raw'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:173:in `block in action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:434:in `lock'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/commands/package/command.rb:83:in `package_vm'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/commands/package/command.rb:66:in `package_base'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/commands/package/command.rb:42:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/cli.rb:42:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:252:in `cli'
from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant:166:in `<main>'
vagrant package --base <name of vm> --output <path>.box
Lets say you virtual machine is named 'my_vm' and you want to drop it into the home directory
vagrant package --base my_vm --output ~/my_vm.box
Vagrant will package your virtual machine into a base box. Whatever you name the box with the output flag, will be the name you use in your vagrantfile.

RVM - Ruby integration was extracted to a separate gem (`remove $LOAD_PATH.unshift`)

I was upgrading to Rails 3.2.6 (ruby 1.9.3-p194) and installing RVM on Debian and using Apache2 server (2.2.19).
I used these very nice instructions: http://dalibornasevic.com/posts/21-rvm-and-passenger-setup-for-rails-2-and-rails-3-apps/
The Apache server configuration /etc/apache2/apache2.conf includes:
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p194#rails326/gems/passenger-3.0.13/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p194#rails326/gems/passenger-3.0.13
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p194#rails326/ruby
When I have set everything up (and got rid of tons of errormessages :) the following error message from passenger appears:
RVM - Ruby integration was extracted to a separate gem, it should be installed by default with RVM, remove the $LOAD_PATH.unshift line and all should be fine again.
By commenting out $LOAD_PATH.unshift in MyApp/config/setup_load_paths.rb this error goes away and instead I get a 500 error, Internal Server Error.
/etc/log/apache2/error.log:
[ pid=5262 thr=3075372800 file=ext/apache2/Hooks.cpp:862 time=2012-07-10 12:33:41.475 ]: Unexpected error in mod_passenger: Cannot spawn application '/var/www/MyApp': The spawn server has exited unexpectedly.
Backtrace:
in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:742)
in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:294)
in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:563)
I would be very pleased if anyone could give me a clue on this problem.
Thank you very much.
Íris

Heroku rake db:migrate aborts; interning empty string... why?

Ok I've tried searching this site for other similar questions, but those that come close have no answers, so hopefully a rails/heroku guru can help me out.
I've created a basic rails app (I'm learning) and managed to have it run on my home machine perfectly. But when I push it to Heroku and type:
heroku rake db:migrate I get the following error/s:
c:\iltapp>heroku rake db:migrate --trace
rake aborted!
interning empty string
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/mapper.rb:1309:in `to_sym'
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/mapper.rb:1309:in `action_path'
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/mapper.rb:1304:in `path_for_action'
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/mapper.rb:1159:in `match'
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/mapper.rb:1360:in `match'
/app/config/routes.rb:11
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec'
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/route_set.rb:233:in `draw'
/app/config/routes.rb:1
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `load'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `load'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:227:in `load_dependency'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `load'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:127:in `reload_routes!'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:127:in `each'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:127:in `reload_routes!'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:120:in `routes_reloader'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/file_update_checker.rb:32:in `call'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:51
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:52:in `call'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:52
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
/app/config/environment.rb:5
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:103:in `require'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:103:in `require_environment!'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:216:in `initialize_tasks'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/ruby1.8.7/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/ruby1.8.7/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/bin/rake:31
/usr/ruby1.8.7/bin/rake:19:in `load'
/usr/ruby1.8.7/bin/rake:19
(in /app)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
Sorry for the long paste, but to be honest I don't know which part of that might me informative. What I have noticed and I hope this isnt the case is I have Ruby 1.9.2 & Rails 3 installed and I see heroku mentions 1.8 above. Would my code be totally incompatible with heroku if I stay with my version or if that is the issue, is there a way around it?
Update #1: I tried #Svilen's suggestion of reseting the db with herolu rake db:reset and get the same error and some new ones, which may or may not be related. And to clarify I am runnign it on a Bamboo Stack (bamboo-ree-1.8.7) Heres what i get:
Couldn't drop hvjiqvwyxn : #<ActiveRecord::StatementInvalid: PGError: ERROR: must be owner of database hvjiqvwyxn
: DROP DATABASE IF EXISTS "hvjiqvwyxn">
hvjiqvwyxn already exists
rake aborted!
interning empty string
Update #2: As per #Svilen's mention of the stacks I have migrated to bamboo-mri-1.9.2 where ruby 1.9.2 (and correct me if I'm wrong) supports "interning an empty string"
Any answers would be much appreciated.
Heroku support Ruby 1.9.2 only on the Bamboo stack. You can check which stack you are using by typing heroku stack. If you are on the old one - Aspen - you can easily move to Bamboo. Check this article in Heroku's Dev Center: http://devcenter.heroku.com/articles/stack
If that's not the case, try resetting the database and forcing all migrations (note: you will lose all existing data!) with heroku rake db:reset. You can also try restarting Heroku beforehand with heroku restart.
If you noticed anything strange during your git push to heroku, it might be relevant to the problem and worth updating your question with additional data.

Resources