Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8630839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:07:55+00:00 2026-06-12T09:07:55+00:00

I am trying to deploy my application code with Chef, which is working for

  • 0

I am trying to deploy my application code with Chef, which is working for one node and failing on another. I cannot determine why it works for one node and not another when they have the exact same config, but I can at least try to debug the problem on the node that fails.

  deploy_revision app_config['deploy_dir'] do
    scm_provider Chef::Provider::Git 
    repo app_config['deploy_repo']
    revision app_config['deploy_branch']
    if secrets["deploy_key"]
      git_ssh_wrapper "#{app_config['deploy_dir']}/git-ssh-wrapper" # For private Git repos 
    end
    enable_submodules true
    shallow_clone false
    symlink_before_migrate({}) # Symlinks to add before running db migrations
    purge_before_symlink [] # Directories to delete before adding symlinks
    create_dirs_before_symlink [] # Directories to create before adding symlinks
    # symlinks()
    action :deploy
    restart_command do
      service "apache2" do action :restart; end
    end
  end

This is my recipe for deploying the code. Notice that I have tried disabling symlinking entirely, as Chef always jams its own defaults in. Even with this I get the error:

================================================================================
Error executing action `deploy` on resource 'deploy_revision[/var/www]'
================================================================================


Chef::Exceptions::FileNotFound
------------------------------
Cannot symlink /var/www/shared/config/database.yml to /var/www/releases/7404041cf8859a35de90ae72091bea1628391075/config/database.yml before migrate: No such file or directory - /var/www/shared/config/database.yml or /var/www/releases/7404041cf8859a35de90ae72091bea1628391075/config/database.yml

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/kapture/recipes/api.rb

 68: 
 69:   deploy_revision app_config['deploy_dir'] do
 70:     scm_provider Chef::Provider::Git 
 71:     repo app_config['deploy_repo']
 72:     revision app_config['deploy_branch']
 73:     if secrets["deploy_key"]
 74:       git_ssh_wrapper "#{app_config['deploy_dir']}/git-ssh-wrapper" # For private Git repos 
 75:     end
 76:     enable_submodules true

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/kapture/recipes/api.rb:69:in `from_file'

deploy_revision("/var/www") do
  destination "/var/www/shared/cached-copy"
  symlink_before_migrate {"config/database.yml"=>"config/database.yml"}
  updated_by_last_action true
  restart_command #<Proc:0x00007f40f366e5a0@/var/chef/cache/cookbooks/kapture/recipes/api.rb:82>
  repository_cache "cached-copy"
  retries 0
  keep_releases 5
  create_dirs_before_symlink ["tmp", "public", "config"]
  updated true
  provider Chef::Provider::Deploy::Revision
  enable_submodules true
  deploy_to "/var/www"
  current_path "/var/www/current"
  recipe_name "api"
  revision "HEAD"
  scm_provider Chef::Provider::Git
  purge_before_symlink ["log", "tmp/pids", "public/system"]
  git_ssh_wrapper "/var/www/git-ssh-wrapper"
  remote "origin"
  shared_path "/var/www/shared"
  cookbook_name "kapture"
  symlinks {"log"=>"log", "system"=>"public/system", "pids"=>"tmp/pids"}
  action [:deploy]
  repo "git@github.com:kapture/api.git"
  retry_delay 2
end

[2012-09-24T15:42:07+00:00] ERROR: Running exception handlers
[2012-09-24T15:42:07+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[2012-09-24T15:42:07+00:00] ERROR: Exception handlers complete
[2012-09-24T15:42:07+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2012-09-24T15:42:07+00:00] FATAL: Chef::Exceptions::FileNotFound: deploy_revision[/var/www] (kapture::api line 69) had an error: Chef::Exceptions::FileNotFound: Cannot symlink /var/www/shared/config/database.yml to /var/www/releases/7404041cf8859a35de90ae72091bea1628391075/config/database.yml before migrate: No such file or directory - /var/www/shared/config/database.yml or /var/www/releases/7404041cf8859a35de90ae72091bea1628391075/config/database.yml

Here you can see it mention database.yml, tmp/, system/ and pids folders, all of which are defaults that Chef likes to set (see related bug)

Question 1

What are these symlinks for and how do I know if I even need any. What sort of things am I symlinking? I will be using migrations, so if they are useful for the migration then I’ll need them working.

I have read the documentation many times and it just doesn’t explain this is plain English – at least not that I have found.

Question 2

If I do not require them, how can I disable symlinking entirely? Following the examples in that bug report have not helped.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:07:56+00:00Added an answer on June 12, 2026 at 9:07 am

    Clear out all the symlink attributes.

    deploy_revision("/var/www") do
      # ...
      symlink_before_migrate.clear
      create_dirs_before_symlink.clear
      purge_before_symlink.clear
      symlinks.clear
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to deploy my HelloWorld application in Windows Azure which was developed in
I'm trying to deploy my War application in JBOSS 5.1 standalone which has been
I'm trying to deploy an application on the mac app store. I'm working through
I'm trying to deploy an EventMachine application with Capistrano. Deploying the code looks fairly
I am trying to deploy my JPA application on 2 separate instances within the
I am trying to deploy a playframework application to Heroku. After deploying, I trying
I'm trying to deploy a rails application locally to a cluster of EC2 machines
I am trying to deploy a Spring application on WAS 6.0 (JDK 1.4.2). Day
I'm trying to deploy a java application to appspot (google appengine). I'm new to
I am trying to deploy a Django application in a production environment and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.