Author: December 2009 Archives

Maybe you just upgraded Groovy on Grails, or maybe you’re doing a fresh install. Either way you may be confronted with this curious error message:

$ grails test
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/cli/support/GrailsStarter

What’s wrong? You have a grails mismatch. Your GRAILS_HOME environment variable is not pointing to the same place as the grails in your PATH. Make them agree and try your grails command again.

0 Votes

I ran into this very cryptic one while setting up Nagios at Joyent. I copied my plugins from one nrpe client to a new server. Three of my checks used check_procs which all failed with a message like this:

check_procs
System call sent warnings to stderr: pst3: This program can only be run by the root user!

To make this even more annoying, sudo did not fix it. The same error message was displayed. What was the problem? File permissions! The error message should say “This program must be owned by the root user!” The fix:

sudo chmod root:root pst3
0 Votes

Do you need to cancel / abort / terminate a long running query in PostgreSql? Perhaps you ran a very nasty select or kicked off an index creation that’s blocking inserts. Either way, stopping a long running query is easy.

  1. Log into postgres as the super user: psql -U postgres
  2. Find your query
postgres=> select procpid, current_query from pg_stat_activity;
 procpid |                                                                                                                                   current_query                                                                                                                                    
---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    8093 | <IDLE>
    8172 | <IDLE>
    9357 | <IDLE>
    9358 | <IDLE>
   17360 | select procpid, current_query from pg_stat_activity;
    9359 | <IDLE>
   22429 | drop index fooindex;
   20363 | <IDLE>
   29098 | <IDLE>
    1083 | <IDLE>
   10812 | <IDLE>
   10855 | <IDLE>
(13 rows)
  1. Use pg cancel backend to stop the query
postgres=# select pg_cancel_backend(22429);
 pg_cancel_backend 
-------------------
 t
(1 row)

All done. Your query was cancled. If you were creating an index you may have an invalid index which will require clean up later.

0 Votes

About this Archive

This page is an archive of recent entries written by Author in December 2009.

Author: November 2009 is the previous archive.

Author: January 2010 is the next archive.

Find recent content on the main index or look in the archives to find all content.