error: Grunt :: Warning: Clean operation failed.

1,478 views
Skip to first unread message

Graham Clarke

unread,
Sep 18, 2013, 9:15:19 PM9/18/13
to sai...@googlegroups.com
Hi - I'm seeing the error below along with some other Grunt errors.  Any thoughts or insights as to what might be causing this are appreciated.

Thanks,
Graham

error: Grunt :: Warning: Clean operation failed. Use --force to continue.
 Running "clean:dev" (clean) task

Cleaning ".tmp/public"...
ERROR

Warning: Clean operation failed. Use --force to continue.


error: Grunt :: 
Aborted due to warnings.
 Running "clean:dev" (clean) task

Cleaning ".tmp/public"...
ERROR

Warning: Clean operation failed. Use --force to continue.


error: *-> An error occurred-- please fix it, then stop and restart Sails to continue watching assets.

Gabe Hernandez

unread,
Sep 19, 2013, 12:44:52 PM9/19/13
to Graham Clarke, sai...@googlegroups.com
The grunt clean task removes the .tmp/public directory. The clean task is the the first task that's run anytime you run 'sails lift' or anytime you make a change to a file in your assets directory. Since It seems to be running that task I think the problem might be that the clean task is not being loaded. 

I get the same error as you do when I comment out this line

  grunt.loadTasks(depsPath + '/grunt-contrib-clean/tasks');

Do you still have this line or do you have it commented out? Make sure you still have this entire block of code in your Gruntfile.

  // Get path to core grunt dependencies from Sails
  var depsPath = grunt.option('gdsrc') || 'node_modules/sails/node_modules';
  grunt.loadTasks(depsPath + '/grunt-contrib-clean/tasks');
  grunt.loadTasks(depsPath + '/grunt-contrib-copy/tasks');
  grunt.loadTasks(depsPath + '/grunt-contrib-concat/tasks');
  grunt.loadTasks(depsPath + '/grunt-sails-linker/tasks');
  grunt.loadTasks(depsPath + '/grunt-contrib-jst/tasks');
  grunt.loadTasks(depsPath + '/grunt-contrib-watch/tasks');
  grunt.loadTasks(depsPath + '/grunt-contrib-uglify/tasks');
  grunt.loadTasks(depsPath + '/grunt-contrib-cssmin/tasks');
  grunt.loadTasks(depsPath + '/grunt-contrib-less/tasks');
  grunt.loadTasks(depsPath + '/grunt-contrib-coffee/tasks');


If you do have that, make sure that in the 'node_modules/sails/node_modules' directory that your see a list of directories that that look like this.
  'grunt-contrib-*sometTaskName*'.

If you don't see these, I would remove and reinstall your local version of sails for this project. Doing that should bring those in?

Graham Clarke

unread,
Sep 19, 2013, 2:01:03 PM9/19/13
to sai...@googlegroups.com, Graham Clarke
Gabe - Thanks for the reply.  This helps me understand a little better what is happening, but no clear solution yet.  My install looks correct based on what your post.

The errors appeared after the app had been running successfully for a couple of hours.  The part of the functionality of the app is to process video clips that get auto loaded into /assets/video/clips/   In Gruntfile.js I launch a process whenever a new clip appears in that directory.  Part of the process makes a thumbnail of the video and puts it into /assets/video/thumbs/

The app works pretty well for a while and then seems to get bogged down and start throwing these Grunt errors.

Let me know if you have questions or have additional insights.

Thanks
Graham

Jeremy Hazel

unread,
Sep 24, 2013, 6:26:27 PM9/24/13
to sai...@googlegroups.com, Graham Clarke
I'm getting the same error, I'd be interested to see if you have found a solution?

Graham Clarke

unread,
Sep 24, 2013, 6:35:53 PM9/24/13
to sai...@googlegroups.com, Graham Clarke
I have not found a real solution yet.  We tested in a "live" setting over the weekend and needed to restart the app periodically.  Was using forever and had to use "forever stop".  That worked, but is not viable longer term.

I need to setup better monitoring to see if this is a memory issue or if there are file collisions in the file system.

Graham

Jeremy Hazel

unread,
Sep 24, 2013, 10:01:01 PM9/24/13
to Graham Clarke, sai...@googlegroups.com
Looks like I was able to fix the issue by using sudo or running as root.

Jeremy

Graham Clarke

unread,
Sep 24, 2013, 11:00:31 PM9/24/13
to sai...@googlegroups.com, Graham Clarke
Cool.  Are you running forever with sudo?

Like this ...
>$ sudo forever start myapp.js

Jeremy Hazel

unread,
Sep 25, 2013, 1:15:44 PM9/25/13
to Graham Clarke, sai...@googlegroups.com
Yes sir...

Make sure you use sudo forever list to see the process as well.

Good luck!

uncletammy

unread,
Oct 14, 2013, 12:09:06 AM10/14/13
to sai...@googlegroups.com
I ran into this problem after running 'sudo sails lift'.  I think this created an ownership problem.  To fix it, I ran 'sudo chown <my username> -R * ' from my sails project's root directory and the problem went away.  
Reply all
Reply to author
Forward
0 new messages