VS2013 Web Deploy Replace from Server error - visual-studio-2013

I have deployed web applications using web deploy on to iis7.5 without issues, the preview works and It updates only the necessary files when publishing again. We have designers who like to change the css files with FTP and I thought the Replace fileName from server commands in Visual Studio would be great to pull their changes into TFS.
Every time I run it it comes up with the error :
The synchronization is being stopped because the maximum number of sync passes '5' has been exceeded even though all the changes could not be applied. This could occur if there are external changes being made to the destination.
If anyone could shine some light on the error or some documentation regarding this feature, that would be great.

Web Deploy does at least 2 passes to do a remote sync (when either the client or server is remote which is in your case too). At the end of these passes, web deploy does a metadata check to see if all the files are in sync.
If by then other changes have happened (such as someone else started a web deploy sync to the same destination, or a few files were edited via the web or via ftp or any other means) then web deploy will attempt a 3rd pass to get them in sync with the source. If the changes keep happening the passes will keep happening.
But since we dont want to sync the content for ever we placed a max retry limit of 5. You can actually override to something higher but its not recommended.
Update:
You can set this in two ways:
pass in a flag -retryAttempts=7 (or any number) to msdeploy from command line
Set RetryAttemptsForDeployment in VS targets or use it as an MSBuild property. Its described here

Related

How to deploy a web app without stop and restart

I built the project to binary file and deployed it to server before. and start it with nohup. But if I updated my code and rebuild my program. I must to kill the process first, then updated the file and start again.
My problem is:
The app must be down with at least few seconds.
I must update file manually (login the server, kill process, replace file, and then start it)
Is there anyway to hot update the program, something like PHP? I just need update my code to server by git (or svn or others way). then the server will rebuild app and graceful restart it.
Usually you run more than one instance of your web application behind a reversed proxy, eg nginx, or any other load balancer. If the few second downtime is an issue for you then you need to have a HA setup anyway. And in such setup you can do a rolling update, where you are replacing instances one by one.
Quick googling will let you find instructions how to do the deployment eg: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-go-web-application-using-nginx-on-ubuntu-18-04

JBoss-Spring web application development process is so slow

Our team is developing a JBoss-Spring web application. The development follows this flow:
1) make local changes in the project's code (Java classes, HTML, JS code and different configuration values)
2) build the project locally
3) deploy it to a locally set JBoss server
4) the local server makes connections and quires to a remote database, which we are enabled to connect to
by a VPN.
5) quires results come back from the remote database and used by the services and controllers,
ultimately reaching the front-end.
As you can notice, this process takes a lot of time waiting between the build - deployment - database quires every time I want to add a few lines of code.
is this process wrong ?, are there other methods ?
Thanks.
Few addons you can consider if not done already
Changes to HTML, js, css and properties file you can do directly inside deployment folder.
Java file changes need a build and restart. You can configure Automatically publish in your IDE. This will reduce time for manual building and copying file to Jboss.
If you can have local DB request/response time will reduce drastically.

Web Deploy no longer works

My team uses Web Deploy in order to deploy updates to our website on to our production server. The last few days I've been doing some housekeeping and have changed my password (which I made sure to update in my Web Deploy configuration) and moved the solution for our website to a different location in TFS. I'm not sure which (if either) of these has caused the issue, but I am now no longer able to publish our website using Web Deploy.
I can preview the publish fine, but I can't actually publish it.
The Output in Visual Studio shows this:
Start Web Deploy Publish the Application/package to https://[REDACTED]:8172/msdeploy.axd?site=[REDACTED] ...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4270,5): Error ERROR_COULD_NOT_CONNECT_TO_REMOTESVC: Web deployment task failed. (Could not connect to the remote computer ("[REDACTED]") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.)
Publish failed to deploy.
(Note that I've removed some identifying information from this log, which has been replaced with '[REDACTED]')
I found a page describing this issue here: http://www.iis.net/learn/publish/troubleshooting-web-deploy/troubleshooting-web-deploy-problems-with-visual-studio
It says to check in the WMSvc log to find the status and substatus codes for further troubleshooting.
Here I've colour coded lines relating to the preview in green and lines relating to the actual publish in red. As you can see, the requests returned with a 200 (OK) status, meaning the server is not aware of any error occuring. However Visual Studio reports a failure and my production website has not been updated.
The fact that log entries are generated tells me that Web Deploy is properly installed and the handler is setup correctly.
It seems the deploy always fails after ~30 seconds. This could be coincidence, but I'm wondering if there's a timeout at play.
Could anyone suggest further troubleshooting steps?
EDIT: This issue occurs when I try to publish to ANY server, so it's definitely a client issue and not a server issue.
EDIT2: I have two branches of my project, Main and Dev. I just discovered that I can still publish from Dev, just not from Main. They both have identical settings. Very weird.
This can be caused by few reasons. I've written this blogpost earlier about the issues.
When we install the Web Deploy tool, it creates local users "WDeployConfigWriter" and "WDeployAdmin". In your case, you've explicitly changed the password to reset these local users passwords I think, or, the passwords of those in charge. To reset these local users passwords, you can do following:
"Control Panel -> User Accounts -> Give other users access to this
computer -> Advanced -> Advanced -> Users"
Reset WDeployConfigWriter's password
Reset WDeployAdmin's password
"IIS -> Server Node -> Management Service Delegation"
Right click on each
rule with users "WDeployAdmin" and "WDeployConfigWriter"
Click Edit
Click on "Set..." button in "Run As" group
Enter the name of the account you are going to update the password of
Enter password on two areas
If the operation is still erroneous see Event Logs on Windows, they are the real deals here. Check this link.

Lotus Domino: Migrating code changes to production, in clustered environment

We have clustered environment for domino server on production. I want to migrate code changes from staging to production. I have not changed signature for any of the old functions in the script library, but I have added a new function in the script library which is being called by a specific agent. All works well in staging. Now I want to transfer these changes to the cluster(consists of two servers) in production.
If I copy paste the new function(in script library) and also the changed agent which call this new function to one of the server in production, will these code changes automatically be replicated to the other server?. I mean what's the best way to migrate these changes?.
Thanks in advance.
Data and design elements get replicated immediately between clustered servers. So, if you change an agent or script library on first server the second server gets changes only seconds after.
Sometimes you get an error message "Error loading USE or USELSX module" after changing a script library. The error occurs if you call an agent or open a form which uses the script library. In this case, you have to recompile the agent or form to work the design elements properly with the new internal structure of the script library.
This error won't probably appear in your case as your changes work well in development environment. You should test all parts of your application which use the changed script library though to make sure it will work fine.
If you really want to make it seamless:
1) make your staging database a master template, and
2) make your production database inherit the design from that master template.
Then, on one of your production databases, Application > Refresh Design, and it'll ask what server to refresh the design from. Make this your staging server.
It's particularly important to recompile all LotusScript if you don't do this; otherwise, you may end up with "Type mismatch on external name: ". If you do this on your staging server, both the uncompiled and the compiled LotusScript design documents will be part of the design refresh, and it'll make things a lot easier.
Note that all clients must completely close and reopen the database to recognize any code changes. (This means 'the database tab itself, as well as any documents that are open from that database'.)

how do I use web deploy to deploy multiple sites on localhost with different ports

I have a solution that contains multiple integration test projects and one web application project. each integration project connects to the web application when running the tests. I would like for each test project to access the website with its own database connection. I have been trying to use the web deploy functionality built into visual studio. However I have been unable to figure out what I need to add to either the deployment package that is created and/or the post build event for the test projects to declare the binding port for the website when deployed. For example, I want integration project A to create and access the website located at http://localhost:83 and integration project B to create and access the website located at http://localhost:82. Could someone please explain:
Is there anything I need to do the deployment package ?
What do I need to add to my post-build events for my integration projects when deploying the package, so that the website is created at the correct port when building the project?
Update:
I'm wanting to deploy the same site to two different locations on my machine so that I can run both sets of integration tests at the same time.
Update 2:
I have researched the web deploy tool and it allows you to specify parameters that modify what is deployed when you call it from the command line. However I have found the documentation very confusing. http://technet.microsoft.com/en-us/library/dd568968(WS.10).aspx
Update 3:
I expect these to be two different websites, each pointing to there own database. If possible I would like a single package that can be deployed using msdeploy. Which will then be called in a post build event from each of the integration test projects. I would like to specify the connection string and deployment location from the post build script of the integration project.
you can try with webdev.server included in visual studio. VisualStudio use this for start a webserver when you debug. With this you can start a webserver in the desire port (if the port is not used currently).
I made a bat file for change some options.
check it.
::Begin of bat file
cd C:\Program Files\Common Files\microsoft shared\DevServer\10.0\
WebDev.WebServer40.exe /port:80 /path:"C:\PATHTOYOURWEBPROJECT" /vpath:"/NAMEOFYOURWEBPROJECT"
::End of bat file
You can acces in: http://localhost:80
I use the webserver40, but if you don't have net.4 or vs2010 you can try to find webserver[ xx version].exe
I hope that this will be helpful, and sorry for my broken english.
First off, you're approaching this the wrong way.
> I would like for each test project to access the website with its
own database connection.
Who is creating the DB connection? Your web site or the test project? For rest of your question to make sense, I presume its the web site (otherwise, Project A and Project B cannot share a connection out of the box).
If your website is making the connection, unless you're caching or having a static connection, there will be a new connection made as each request runs your your site on a new thread. Another simpler alternative is to take a query param and initiate a new connection based on that. If you seed it off the caller, you can also use it for more detailed logging.
Web Deployment projects are meant for deploying to integration servers, so that means you cannot access them by http://localhost... but the full FQDN of the server.
Most importantly, http://localhost:82/myApp and http://localhost:83/myApp are two different sites (unless you redirect from one of them to another one which in itself can cause additional issues) running the same codebase.
Having said that, you would then need to deploy your website twice and then all you need is to change the config/settings entry in Project A and B to point to these to different sites.
Hope this makes sense.
You can define virtual host configuration.
Refer this guide for more information.
http://docs.jboss.org/jbossas/guides/webguide/r2/en/html/ch07.html

Resources