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

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

Closed
naris opened this issue Dec 21, 2023 · 17 comments
Assignees
Labels
Status: Open Issue has been triaged by the front-line engineers and is being worked on verification Type: Bug Label issue as a bug defect

Comments

@naris
Copy link

naris commented Dec 21, 2023

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

@naris naris added Status: Open Issue has been triaged by the front-line engineers and is being worked on verification Type: Bug Label issue as a bug defect labels Dec 21, 2023
@shub8968
Copy link
Contributor

shub8968 commented Jan 8, 2024

Hi @naris,

Would you be kind enough to provide the steps in order to reproduce the issue and verify.

Thanks.

@naris
Copy link
Author

naris commented Jan 9, 2024

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

@naris
Copy link
Author

naris commented Jan 9, 2024

In the administration UI, it only allows a selection of "targets", which only includes server instances, not virtual servers such as this screen shot shows (we have a second instance called instance2 in addition to the default server):
target_list

@naris
Copy link
Author

naris commented Jan 9, 2024

Then, after the application has been deployed you have to go to the target tab
application_targets
and pick which server it should show up on, all the virtual servers on the server that was selected will always be selected after deploying the war file:
virtual_server_list

@naris
Copy link
Author

naris commented Jan 9, 2024

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.

@naris
Copy link
Author

naris commented Jan 9, 2024

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

@naris
Copy link
Author

naris commented Jan 9, 2024

You have to disable, or undeploy, all of the applications on a server in order to deploy any of them or you get an error like this
virtual_error

@fturizo fturizo assigned fturizo and unassigned shub8968 Jan 25, 2024
@fturizo
Copy link
Contributor

fturizo commented Jan 25, 2024

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:

Application Deployment

In this example, I can select the default server virtual server and 2 additional virtual servers I created to test this use case. Even after the application has been deployed, it is possible to modify the application's selected virtual server in its edit view:

Application Edit

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 fturizo added Status: Pending Waiting on the issue requester to give more details or share a reproducer and removed Status: Open Issue has been triaged by the front-line engineers and is being worked on verification labels Jan 25, 2024
@naris
Copy link
Author

naris commented Jan 27, 2024

@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?
I only see a list of targets as shown in the screenshot I posted earlier, which are instances (server and instance2 since we have a 2nd instance defined) with no way to specify a virtual server.

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.

@naris
Copy link
Author

naris commented Jan 27, 2024

This is all I see when I deploy an application using Payara 6.2023.11 and is all I have ever seen with Payara 5 also, it has always been like this:
image
image

@naris
Copy link
Author

naris commented Jan 27, 2024

The General Application page also does not look like your screenshot and does not have a section for virtual servers -- it looks like this:
image

@naris
Copy link
Author

naris commented Jan 27, 2024

The only way to even see the Virtual Servers, and set them, are from the target tab, AFTER the application has been deployed:
image
and then clicking the Manage Virtual Servers link:
image

@naris
Copy link
Author

naris commented Jan 27, 2024

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:
asadmin deploy --force=true --upload=true --name "${APP_NAME}" --contextroot "/" --virtualservers "${VIRTUAL_SERVER}" "${WAR_FILE}"

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

@naris naris changed the title Bug Report: Deploying applications to Virtual Servers payara 6 (and 5) is extremely difficulty and has to be done manually. Bug Report: Deploying applications to Virtual Servers payara 6 (and 5) is extremely difficult and has to be done manually. Jan 27, 2024
@naris
Copy link
Author

naris commented Jan 27, 2024

BTW, we are using the Community Edition of Payara Server 6.2023.11 and are deploying .war files.

@naris
Copy link
Author

naris commented Jan 27, 2024

I don't know if this makes a difference, but as I stated above, we do have a 2nd instance defined:
image

@fturizo fturizo added Status: Open Issue has been triaged by the front-line engineers and is being worked on verification and removed Status: Pending Waiting on the issue requester to give more details or share a reproducer labels Jan 30, 2024
@naris naris changed the title Bug Report: Deploying applications to Virtual Servers payara 6 (and 5) is extremely difficult and has to be done manually. Bug Report: Deploying applications to Virtual Servers payara 6 (and 5) is extremely difficult and has to be done manually when instances are defined. Feb 16, 2024
@naris
Copy link
Author

naris commented Feb 16, 2024

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.

@fturizo
Copy link
Contributor

fturizo commented Feb 16, 2024

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 deploy subcommand. Here's an example:

 asadmin deploy --virtualservers=vs-2,vs-1 --target=local-instance-1 clusterjsp.war

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:

image

Then you can view and modify the application's selected virtual servers for the specified target:

image

In the command samples you provided, I don't see any specific instances being set using the --target argument. To get your command working correctly and set the virtual servers as intended, you'll have to specify valid targets as per my example above.

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.

@fturizo fturizo closed this as completed Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Open Issue has been triaged by the front-line engineers and is being worked on verification Type: Bug Label issue as a bug defect
Projects
None yet
Development

No branches or pull requests

3 participants