Expand my Community achievements bar.

SOLVED

Dispatcher SymLinks Configurations

Avatar

Community Advisor

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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!
 

View solution in original post

5 Replies

Avatar

Community Advisor

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

Avatar

Correct answer by
Community Advisor

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!
 

Avatar

Level 2

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

 

Avatar

Level 8

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