---
title: "Code deploy failing due to \"error: unable to create symlink xxx (File name too long)\""
date: "2024-03-14T14:34:34+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/92961-code-deploy-failing-due-error-unable-create-symlink-xxx-file-name-too-long"
id: "a50af756-68a5-4033-a488-99d074cfa1d7"
---

Table of contents will be added

Issue
-----

When trying to deploy code, the task fails and the logs show the error:

    "error: unable to create symlink xxx (File name too long)"

Resolution
----------

This error indicates an issue with your committed files. There are two methods to resolve this issue: 

### Recreating missing symlinks

If you see the symlinks are in your vendor/bin folder the easiest way to resolve this issue is removing the vendor and  regenerating it. Make sure to update your your Composer to the latest version.

    composer self-update
    rm -rf vendor 
    composer install

If this is not the case please continue to read:  
  
Create a new branch based on the branch you are reporting issues with, you will need to use -f to force the branch to checkout properly:

    git checkout -f feature/example

Create a new branch based on this:

    git checkout -b feature/example_2

and recreate the missing symlinks by doing the following, for example:

    git rm --cached vendor/bin/var-dump-server
    git add vendor/bin/var-dump-server

You should be able to see \`typechange\` when you are running \`git status\`:

    $ git status
    On branch master
    Your branch is up-to-date with 'origin/master'.
    Changes to be committed:
      (use "git reset HEAD <file>..." to unstage)
    
    	typechange: vendor/bin/var-dump-server

### Setting symlinks to false

If you are using a Windows-based Git client, you should be able to fix using the following:

    git config core.symlinks false

You can also, set symlinks to false in the core section of .git/config file.

    [core]
    
    ...........
    
    symlinks = false

Cause
-----

The following source provides details on the cause of this issue:

[_https://stackoverflow.com/questions/18411200/git-unable-to-create-symlink-file-name-too-long_](https://stackoverflow.com/questions/18411200/git-unable-to-create-symlink-file-name-too-long "https://stackoverflow.com/questions/18411200/git-unable-to-create-symlink-file-name-too-long")_._

_\>>> As soon as you changed the content of a fake-symlink-file without also changing its mode from symlink to regular file and committed the result, you made a blob that can't be extracted on an OS with real symlinks, because you have an object that is supposed to be a symlink but its content is too long to be a pathname. The web interface is not doing you any favors by hiding this problem. You're probably going to have to back up to that commit, fix it, and re-commit everything after it. git rebase -i will help, but it still might not be easy, especially if you've made more changes to the files while they were in this bogus symlink-but-not-really-a-symlink state._