Dispatcher SymLinks Configurations | Community
Skip to main content
Rohan_Garg
Community Advisor
Community Advisor
July 29, 2022
Solved

Dispatcher SymLinks Configurations

  • July 29, 2022
  • 3 replies
  • 5874 views

Hi AEM Community,

 

The issue with symlinks has been frequently raised and discussed.

Blog Reference - https://medium.com/tech-learnings/aem-dispatcher-configurations-symlinks-8f52f554ffa5

 

I would like to discuss my use case as well - 

 

1. I created symlinks on my windows machine using "mklink src target" utility.

However, I got the below error - 

 

2022/07/29 18:16:54 Dispatcher configuration validation failed:
/tmp/dispatcher/unzippedConfiguration/conf.dispatcher.d/enabled_farms/abc.farm: appears to be a windows (pseudo) symlink but this OS does not support these. Please commit a correct symlink: ../available_farms/abc.farm
The command '/bin/sh -c AZCOPY="/usr/bin/azcopy" VALIDATOR_BINARY="/usr/bin/dispatcher-configuration-validator" HTTPD_BINARY="/usr/sbin/httpd" DISPATCHER_CONFIGURATION_LOCATION=$dispatcherConfigurationLocation DISPATCHER_CONFIGURATION_DESTINATION=$dispatcherConfigurationDestination DISPATCHER_IMAGE=$dispatcherImage RUN_MODE=$runmode ./validateDispatcherConfiguration.sh' returned a non-zero code: 2
2022/07/29 18:16:54 Container failed during run: validate-dispatcher. No retries remaining.
failed to run step ID: validate-dispatcher: exit status 2

 

How can we create symlinks for Cloud/linux based OS on windows machine ?

 

2. Used Debian WSL-2 compatibility layer

I was able to create the symlinks using Debian however I had the issue of authentication in pushing the changes to remote.

My credentials were not authorized (Read somewhere that for two factor authentication it doesn't work)

So I committed the changes using Debian interface and pushed it using windows shell.

Still I got the same error.

 

Can you please help on how to proceed as I seem to be unable to create symLinks that would work on cloud ?

 

Thanks,

Rohan Garg

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rohan_Garg

Hi All,

 

I was able to resolve the issue by pushing symlinks created on Ubuntu WSL to my remote repo.

To summarize - 

In AEM RELEASE:

2022.6.7904.20220629T070041Z
 
The symlinks created on windows machine and pushed to cloud give the below error - 
/tmp/dispatcher/unzippedConfiguration/conf.dispatcher.d/enabled_farms/default.farm: appears to be a windows (pseudo) symlink but this OS does not support these. Please commit a correct symlink: ../available_farms/default.farm
 
The fix was to generate symlink on WSL application (Debian, Ubuntu both work).
Pushing the commit to azure https remote repo won't work using your normal login credentials.
You will have to generate git credentials (auto generated tokens) to push the changes.
Hope this helps!
 

3 replies

SantoshSai
Community Advisor
Community Advisor
July 30, 2022

Hi @rohan_garg ,

Please check this link if it helps: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/dispatcher-symlinks/td-p/431024 

Ignore if you already visited.

Regards,

Santosh

Santosh Sai
Rohan_Garg
Community Advisor
Community Advisor
July 30, 2022

Hi Santosh,

 

Thanks for the reply. Yes, I have already visited this link.

The solution there by @sean-mck suggested the below - 

So I got on Ubuntu WSL and did a symlink and commited it and it worked.

 

I am able to create symlinks via WSL such as Debian or Ubuntu but am not able to commit it to repo.

My usual authorization fails. This might be due to enabled 2 factor authentication.

 

If I try to create the symlinks via WSL and commit, then push from windows interface I still get the same error as the one in question.

 

Thanks for your time and consideration.

 

Best Regards,

Rohan Garg

Rohan_Garg
Community Advisor
Rohan_GargCommunity AdvisorAuthorAccepted solution
Community Advisor
July 30, 2022

Hi All,

 

I was able to resolve the issue by pushing symlinks created on Ubuntu WSL to my remote repo.

To summarize - 

In AEM RELEASE:

2022.6.7904.20220629T070041Z
 
The symlinks created on windows machine and pushed to cloud give the below error - 
/tmp/dispatcher/unzippedConfiguration/conf.dispatcher.d/enabled_farms/default.farm: appears to be a windows (pseudo) symlink but this OS does not support these. Please commit a correct symlink: ../available_farms/default.farm
 
The fix was to generate symlink on WSL application (Debian, Ubuntu both work).
Pushing the commit to azure https remote repo won't work using your normal login credentials.
You will have to generate git credentials (auto generated tokens) to push the changes.
Hope this helps!
 
ambersingh121
Level 2
October 4, 2024

Hi Rohan,

 

Just wanted to share something that worked for me.

 

Recently while setting up dispatcher farm files for my project I came across this issue of creating symlinks on windows machine. I too used the mklink command line utility to create symlinks, just that for target path I gave unix pattern relative URL.

 

"mklink src target"
e.g.

mklink "C:\repo\aem-cloud\dispatcher\src\conf.dispatcher.d\enabled_farms\abc.farm" "../available_farms/abc.farm"

 

Now this means that the created symlink won't work on my windows machine, but works fine on AEMaaCS instance.

 

Regards,

Amber

 

daniel-strmecki
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 4, 2024

Here is a bash script I use on Mac to fix all symlinks in case they got broken by pulls from Git:

 

 

project_root=$(pwd) cd dispatcher/src/conf.d/enabled_vhosts enabled_hosts=$(ls *.vhost) for host in $enabled_hosts; do rm $host ln -s ../available_vhosts/$host $host done cd $project_root cd dispatcher/src/conf.dispatcher.d/enabled_farms enabled_farms=$(ls *.farm) for farm in $enabled_farms; do rm $farm ln -s ../available_farms/$farm $farm done

 

 

 

Hopefully it help,

Daniel