Loading...


Related Products


Date Published: March 14, 2024

Code deploy failing due to "error: unable to create symlink xxx (File name too long)"

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:  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
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.

>>> 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.

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation