Psych::SyntaxError during deployment

187 views
Skip to first unread message

bparanj

unread,
Jul 9, 2014, 11:05:37 PM7/9/14
to railsmachin...@googlegroups.com
I am using Ruby 2.1.0, Rails 4.1.1 and Capistrano 2.15.4. The error message is:


** [out :: rp] Uncaught exception: Psych::SyntaxError: (<unknown>): found a tab character that violate intendation while scanning a plain scalar at line 19 column 12
 ** [out :: rp] /usr/lib/ruby/2.1.0/psych.rb:370:in `parse'
 ** [out :: rp] /usr/lib/ruby/2.1.0/psych.rb:370:in `parse_stream'
 ** [out :: rp] /usr/lib/ruby/2.1.0/psych.rb:318:in `parse'
 ** [out :: rp] /usr/lib/ruby/2.1.0/psych.rb:245:in `load'
 ** [out :: rp] /usr/lib/ruby/gems/2.1.0/gems/puppet-3.6.2/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb:144:in `load_with_options'
 ** [out :: rp] /srv/lafon/releases/20140710030145/vendor/plugins/moonshine/lib/moonshine/manifest.rb:190:in `<class:Manifest>'
 ** [out :: rp] /srv/lafon/releases/20140710030145/vendor/plugins/moonshine/lib/moonshine/manifest.rb:18:in `<top (required)>'
 ** [out :: rp] /usr/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 ** [out :: rp] /usr/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 ** [out :: rp] /srv/lafon/releases/20140710030145/vendor/plugins/moonshine/lib/moonshine.rb:18:in `<top (required)>'
 ** [out :: rp] /usr/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 ** [out :: rp] /usr/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 ** [out :: rp] /srv/lafon/releases/20140710030145/app/manifests/application_manifest.rb:1:in `<top (required)>'
 ** [out :: rp] /usr/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 ** [out :: rp] /usr/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 ** [out :: rp] /usr/lib/ruby/gems/2.1.0/gems/shadow_puppet-0.9.1/bin/shadow_puppet:137:in `<top (required)>'
 ** [out :: rp] /usr/bin/shadow_puppet:23:in `load'


I added :

 require 'yaml'
 YAML::ENGINE.yamler = 'syck'

to boot.rb with no luck. How can I get past this psych error? TIA.

Kevin Lawver

unread,
Jul 10, 2014, 7:39:31 AM7/10/14
to railsmachin...@googlegroups.com
That's an error in one of your yaml files, not a problem w/ moonshine.

Start your rails console, then run: YAML.load(File.read("config/moonshine.yml"))

You'll want to go through all of your .yml files that moonshine might load (database.yml, and stage config files, etc) until you track down where the error is.  

That error is on line 19 of one of your .yml files.  You just have to track it down and figure out which one.

--
You received this message because you are subscribed to the Google Groups "Moonshine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to railsmachine-moon...@googlegroups.com.
To post to this group, send email to railsmachin...@googlegroups.com.
Visit this group at http://groups.google.com/group/railsmachine-moonshine.
For more options, visit https://groups.google.com/d/optout.

bparanj

unread,
Jul 10, 2014, 4:04:00 PM7/10/14
to railsmachin...@googlegroups.com
You were right.

I used the following syntax checker stolen from stackoverflow:

cat yaml_checker.rb
require 'yaml'

d = Dir["./**/*.yml"]
d.each do |file|
  begin
    puts "checking : #{file}"
    f =  YAML.load_file(file)
  rescue Exception
    puts "failed to read #{file}: #{$!}"
  end
end

Fixed the problem with database.yml. Even though it complained about semicolon in vendor/plugins/ yaml template files. The deployment worked. The only other problem I had was the nodejs moonshine plugin is broken. It throws SSL certificate error, redirect error etc. I had to install nodejs manually without using that plugin.
Reply all
Reply to author
Forward
0 new messages