-
Notifications
You must be signed in to change notification settings - Fork 306
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
Bug Report: Deploying applications to Virtual Servers payara 6 (and 5) is extremely difficult and has to be done manually when instances are defined. #6512
Comments
Hi @naris, Would you be kind enough to provide the steps in order to reproduce the issue and verify. Thanks. |
@shub8968 ,All you need to do is create 2 or more virtual servers with apps that use the same root context, such as /, and try to deploy any war file to them. Also, all you really have to do is look at the administration UI to deploy a war file and see that there is no way to indicate a virtual server to deploy to and that it always deploys to all of the virtual servers, even when using asadmin to deploy an application and specifying the --virtualservers parameter. |
and even after you choose the correct instance for the war file you just deployed, in this case us_en, when you go to deploy the second war file, it will conflict with the already deployed first war file so you have to go back to the first application and disable it before you can deploy the second application. |
There really needs to be a way to deploy an application to a single virtual server, and not all of them. Especially when using asadmin, which does have a --virtualservers parameter that it, apparently, ignores :( |
Greetings @naris, We have been reviewing this issue and we are confused about your statements. Attempting to deploy an application in Payara Server 6.2023.12's Admin Console will show this screen: In this example, I can select the default So we're honestly confused about your claims that you cannot deploy an application to a specific virtual server. Deploying the application to all available virtual servers when none are selected is the default behaviour of the server and has always been, but this is not an issue since you can select the virtual server upon deployment. Can you please share a detailed, self-contained reproducer with clear instructions that illustrate the issues you are encountering? We're afraid that without one we cannot assist you in this report as there is no clear indication of what the problem is. |
@fturizo, No I have never seen the screen you show with a list of virtual servers. How do you get that as I have never seen it? Also, when I deploy applications using asadmin, it will ALWAYS deploy to all the virtual servers, even when --virtualservers is specified on the command line to specify only 1. |
Using this ASADMIN command (from our Jenkinsfile) will deploy the application to ALL of the virtual servers, even though --virtualserver specifies which server to deploy it to: Then if an attempt is made to deploy to a different virtual server it will fail because the 1st war file was already deployed to ALL of the virtual servers :( |
BTW, we are using the Community Edition of Payara Server 6.2023.11 and are deploying .war files. |
I have confirmed that this only happens when an instance has been defined. Then the virtual server dropdown no longer appears anywhere and you are left with only a list of available targets which are server + any instances that have been defined as seen above. |
Greetings @naris, We have been reviewing this issue using the information that you supplied, and indeed when there are multiple instances or targets available for deployments, virtual server selection gets trickier. If there are multiple instances the user interface in the Admin console page indeed won't allow the user to select which virtual servers will be used to host the web application in question. This is a limitation of the page since the virtual server list selection will vary depending on the targets selected for the deployment. However, it is indeed possible to specify the virtual servers using the
Once this is done, you'll be able to verify the selected virtual servers using the Admin's Console Target tab in the Application's view: Then you can view and modify the application's selected virtual servers for the specified target: In the command samples you provided, I don't see any specific instances being set using the Alternatively, you can also deploy the application from the Admin Console under the specific targets and then update the corresponding virtual servers using the UI views I showcased above. As the functionality of the server works as intended and virtual servers can be correctly set up for environments where there are multiple targets, we'll proceed to close this issue. |
Brief Summary
Every time an application is deployed to a virtual server, it is always deployed to every virtual server on the server. This produces a "Virtual server <> already has a web module <> loaded at / therefore web module <> cannot be loaded at this context path on this virtual server" error.
This happens even if using ASADMIN and specifying --virtualservers. The admin "Deploy Applications or Modules" page doesn't even have anywhere to specify a virtual server to deploy to, it only has a target - even though the (blog post about Virtual Servers from 2018) has a screenshot that include a Virtual Server list to pick from (which does not exist in the current deployment page).
The only method I have found to be able to deploy to virtual servers is to manually:
1. Clear the default-web-module of every virtual server.
2. Disable or undeploy ALL the applications of every virtual server.
3. Deploy an application.
4. Manually remove all the virtual servers and add the 1 virtual server for that app in the "Manage Virtual Server" link of the Target tab for the application.
5. Manually disable the application.
6. Repeat steps 3-5 for each application to be deployed.
7. Manually enable all the applications for all the virtual servers.
8. Set the default-web-module of every virtual server to the appropriate application.
Since application are always deployed to all virtual servers when using ASADMIN, even when passing --virtualservers, it is not possible to script or automated deployment in any way forcing all deployments of any virtual servers to be a manual process :(
Expected Outcome
There should be a way to deploy an application to only 1 virtual server and not all of them in the administration GUI.
When specifying ASADMIN --virtualservers to specify which virtual server to deploy an application to, it should deploy the application to only that server and not all of them.
It should be possible to deploy an application to 1 virtual server without having to disable or undeploy every other virtual server first.
Current Outcome
There is no way to specify a virtual server when deploying an application using the administration "Deploy Applications or Modules" page, which only has a list of "targets" that only includes "server" and any instances you might have defined (we have 1 other instance defined so the target list is always server & instance2 and does not include any of the 3 virtual servers we have defined).
When using ASADMIN and specifying --virtualservers to specify which virtual server, it deploys the application to all of the virtual servers anyway and not just the one(s) specified.
Reproducer
Configure multiple virtual servers and deploy applications that have / as the context root to each virtual server.
Operating System
Linux RHEL 7 & 8
JDK Version
openjdk version "11.0.20" 2023-07-18 LTS
Payara Distribution
Payara Server Full Profile
The text was updated successfully, but these errors were encountered: