Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archetype fails to run correctly when -DoptionDispatcherConfig=cloud is used on windows #329

Closed
reusr1 opened this issue Jan 22, 2020 · 16 comments
Labels
bug Unexpected problem or unintended behavior that impairs normal functioning of the product. documentation Documentation corrections or improvements.
Milestone

Comments

@reusr1
Copy link

reusr1 commented Jan 22, 2020

Expected Behaviour

archetype is able to create project with cloud ready dispatcher configuration

Actual Behaviour

fails to create the project

Reproduce Scenario (including but not limited to)

on a windows machine with the adobe corp maven repository configured run

mvn archetype:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=22 -DoptionDispatcherConfig=cloud

note: same command works on linux

Platform and Version

windows 10, java8, apache maven 3.5

Logs taken while reproducing problem

[INFO] Parent element not overwritten in D:\aem\sdk\com.headwire.site.hw\it.tests\pom.xml
[INFO] Parent element not overwritten in D:\aem\sdk\com.headwire.site.hw\it.launcher\pom.xml
[INFO] Parent element not overwritten in D:\aem\sdk\com.headwire.site.hw\repository-structure\pom.xml
[INFO] Executing META-INF/archetype-post-generate.groovy post-generation script
Creating content skeleton...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.007 s
[INFO] Finished at: 2020-01-22T06:19:06-08:00
[INFO] Final Memory: 23M/311M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate (default-cli) on project standalone-pom: java.nio.file.FileSystemException: D:\aem\sdk\com.headwire.site.hw\dispatcher\src\conf.d\enabled_vhosts\default.vhost: A required privilege is not held by the client.
@gabrielwalt gabrielwalt added the bug Unexpected problem or unintended behavior that impairs normal functioning of the product. label Jan 22, 2020
@gabrielwalt gabrielwalt added this to the 23 milestone Jan 22, 2020
@joerghoh
Copy link
Contributor

symlink issue?

@reusr1
Copy link
Author

reusr1 commented Jan 22, 2020

@joerghoh could very well be the case

@joerghoh
Copy link
Contributor

I still wonder why we do have symlinks in such a case. It just makes the setup more complicated than it should be.
(For example I don't get why there is a directory "enabled_vhosts". Every vhost present in the config should be active, if you want to remove one, just remove it from the config. Git handles everything else.)

@msagolj
Copy link
Contributor

msagolj commented Jan 22, 2020

hi @reusr1 , yes it looks like a symlink issue. I quickly tested and the command works for me but I have the rights to create symlink. If i remove the right i get the same error. See:

https://stackoverflow.com/questions/8228030/getting-filesystemexception-a-required-privilege-is-not-held-by-the-client-usi

With Windows you can add a user to the list of who may create symbolic links (without disabling UAC) using security policies. Run "secpol.msc" and change "Security Settings|Local Policies|User Rights Assignment|Create symbolic links"

@vladbailescu
Copy link
Member

@joerghoh , as for why we have the symlinks, it's because the dispatcher needs them and the origins trace back to how Apache web server configurations are structured.

@reusr1
Copy link
Author

reusr1 commented Jan 22, 2020

@msagolj thank you - also seems to work if you run the project in an admin console - would probably be good to mention this in the README

@joerghoh
Copy link
Contributor

@vladbailescu I don't think that the "dispatcher" needs them. The setup with the 2 directories available_vhosts with all configurations in there and and a separate directory enabled_vhosts (here you have lots of symlinks adressing files in available_vhosts) is dating back to times when config files were not versioned, and where enabling and disabling can be done quickly. And the files in the enabled_vhosts are only included from a different httpd configuration file.

But it's not a requirement enforced by either httpd or the dispatcher. You can include basically any directory you like.

@vladbailescu
Copy link
Member

@joerghoh unless something changed since https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/dispatcher/overview.html was last updated, they are needed in the current setup and implementation. Agree that we could get rid of them in the dispatcher but I guess people got used to this structure (hence the reference to httpd) so it might cause some confusion.

@kwin
Copy link
Contributor

kwin commented Jan 22, 2020

You can easily set up HTTPD without the enabled vhosts symlink structure. I agree with @joerghoh it just makes things much more complicated. Reenabling and disabling vhosts is anyhow not a real use case without redeployment any longer....

@bstopp
Copy link
Contributor

bstopp commented Feb 4, 2020

It should be noted that this should work fine if the Archetype is run using Windows Subsystem for Linux. (Git commit likely needs to be in this context as well.)

vladbailescu added a commit that referenced this issue Feb 13, 2020
@vladbailescu
Copy link
Member

Documented the workaround in 6ecbe45, to change the way the dispatcher configuration is structured, a request should be sent to the product team.

@vladbailescu vladbailescu added the documentation Documentation corrections or improvements. label Feb 13, 2020
@timdonovanuk
Copy link

Not that the AEM Eclipse plugin has ever actually worked without major issues (even just doing simple stuff), but I'm guessing this issue is responsible for Eclipse now crashing when trying to create an AEM project of Archetype > 22.

@mrv-ymt
Copy link

mrv-ymt commented Sep 14, 2021

I got same your issue and I could build success when run cmd with Administrator permission

@thantapureddy1
Copy link

I am getting similia exception even after running command prompt as administrator.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.797 s
[INFO] Finished at: 2021-12-08T10:36:47+05:30
[INFO] Final Memory: 25M/60M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.2.0:generate (default-cli) on project standalone-pom: java.nio.file.FileSystemException: C:\workspace\RemoteSPA\wknd-app\dispatcher\src\conf.d\enabled_vhosts\default.vhost: A required privilege is not held by the client. -> [Help 1]

Below is the Maven AEM arche type command used to create project.
mvn -B archetype:generate "-DarchetypeGroupId=com.adobe.aem" "-DarchetypeArtifactId=aem-project-archetype" "-DarchetypeVersion=32" "-DaemVersion=cloud" "-DappTitle=WKND App" "-DappId=wknd-app" "-DgroupId=com.adobe.aem.guides.wkndapp" "-DfrontendModule=react"

@giribabugalla
Copy link

I got same your issue and I could build success when run cmd with Administrator permission

It worked for me. Thanks

@ashkouja1
Copy link

command run as administor it will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior that impairs normal functioning of the product. documentation Documentation corrections or improvements.
Projects
None yet
Development

No branches or pull requests