chef-postgresql icon indicating copy to clipboard operation
chef-postgresql copied to clipboard

Removed escaping from DROP ROLE due to error being thrown while dropping user.

Open germs12 opened this issue 10 years ago • 0 comments

I encountered the following issue while trying to drop a user:

================================================================================
Error executing action `run` on resource 'execute[drop postgresql user abc123]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of psql -c 'DROP ROLE IF EXISTS \"abc123\"' ----
STDOUT: 
STDERR: ERROR:  syntax error at or near "\"
LINE 1: DROP ROLE IF EXISTS \"abc123\"
                            ^
---- End output of psql -c 'DROP ROLE IF EXISTS \"abc123\"' ----
Ran psql -c 'DROP ROLE IF EXISTS \"abc123\"' returned 1

and was able to remedy it by removing the escaping that was happening within the user.rb file. It took a couple edits to get it right, so my version jumped by 2. I'm also a chef n00b, so let me know if something needs to be modified. Thanks!

germs12 avatar May 27 '15 13:05 germs12