Not able to host Xero oAuth20 dll in Azure Server - azure-devops

I have implemented Xero oAuth20 in Asp.Net Web forms using Xero.NetStandard.OAuth2 -Version 0.4.0 version from Nuget package manager.
This is working fine in my local, how ever if I try to deploy solution in Azure server, the publish is getting failed.
Please help to fix this issue.
This is the error
"Your role instances have recycled a number of times during an update or upgrade operation. This indicates that the new version of your service or the configuration settings you provided when configuring the service prevent the role instances from running. Verify your code does not throw unhandled exceptions and that your configuration settings are correct and then start another update or upgrade operation."

Related

Failed to deploy web package to IIS website. By the Self-hosted Windows agent

Failed to deploy web package to IIS website
I have created one ASP.NET Core application and Azure DevOps continuous integration (CI) and continuous delivery (CD) pipeline.
I have created and configure the Self-hosted Windows agents in my local machine as a service. It is working as expected.
When I run the CI/CD pipeline for the first time it is working successfully, and the web application published to my local IIS successfully.
The issue is when I commit another update to Azure DevOps git repository it is failed to deploy web package to my local IIS website with the following errors and warnings
2019-08-21T10:56:59.1480862Z ##[error]Failed to deploy web package to IIS website.
2019-08-21T10:56:59.1492670Z ##[warning]Can\'t find loc string for key: Trytodeploywebappagainwithrenamefileoptionselected
2019-08-21T10:56:59.1493093Z ##[warning]Trytodeploywebappagainwithrenamefileoptionselected
2019-08-21T10:56:59.1493421Z ##[error]Error Code: ERROR_FILE_IN_USE
More Information: Web Deploy cannot modify the file 'DemoWebApp.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.
Error count: 1.
I have configured the appOffline rule in the publishing profile (.pubxml) and add the EnableMSDeployAppOffline element to the PropertyGroup like this:
<PropertyGroup>
<EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>
</PropertyGroup>
As described in More Information’s learn more URL http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.
Still it is failed to deploy web package to my local IIS website with the same errors and warnings.
When I trying to redeploy manually few times then it is working successfully other wise failed with same errors and warnings. Because I think the file is locked for some time in my local machine process.
It is also working successfully when I manually delete all the files from IIS release folder with that locked file.
Needs help, the file is locked by any one local process. I couldn’t find that local process. I couldn’t figure out the issue. I also don’t know if I found that process any how then how to figure out the issue. Is this just local issue?
Can anyone help me out?
Recycle the application pool immediately before your 'Deploy IIS App' task.
Add a 'WinRM - IIS Web App Management' task to you release pipeline. Set the Configuration type to 'IIS Application Pool', set the 'Action' to Recycle, and type in the app pool name in the 'Application pool name' field.
The recycle should unlock the dll and allow it to be deleted and replaced in the deployment step.
I encountered this same error despite having the Take App Offline option set for ages. That can't be the solution. There's some phantom bug going on here, but I did get it resolved without rebooting the server.
In PROCMON, I searched Associated Handles for the file in use. There were none.
I tried deleting the app's DLL file outright; an error message said it was in use by w3wp.exe even though the website was offline and the app pool stopped.
I confirmed this by opening IIS and looking at the worker processes panel. None of the active w3wp.exe PIDs were related to the application I was trying to update.
I opened PROCMON and sorted by Image name to find any W3WP.exe instances still running. There was one Suspended instance that it wouldn't let me terminate (despite running PROCMON as an admin/with elevation). It simply said "Access is denied."
I restarted the Agent on the server via the Services window.
At that point, I was able to delete the application DLL from the target directory and deploy normally from DevOps pipelines.
Hopefully this doesn't happen in production.
I had the same error .
I splved by checking the "enable IIS" to my task , like this :
Now my lob suuccseded
I was deploying my web app on local iis using IIS Web App Deploy task.I was able to reproduce the same error. I found this error occurred if i was visiting my website when i was trying to deploy a new version. And the deploy task failed to update the .dll file, since it was in use.
I fixed this error by checking this option “Take App Offline”, See below pic.
Please let me know If you are using different tasks to deploy your web app.

how to fix ERROR_DESTINATION_NOT_REACHABLE error in azure web app deployment using VSTS

I am using VSTS pipeline to deploy asp.net core 2.2 MVC to azure web app.
The last step which is deploy to azure fails - please see the error below:
##[error]Failed to deploy web package to App Service.
2019-01-08T21:39:47.3810424Z ##[error]Error Code:
ERROR_DESTINATION_NOT_REACHABLE More Information: Could not connect to
the remote computer ("our website url"). On the remote computer, make
sure that Web Deploy is installed and that the required process ("Web
Management Service") is started. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Error: Unable to connect to the remote server Error: A connection
attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because
connected host has failed to respond ????:443
I even tried to Take App Offline but no luck:
However, it works fine if I publish the web app through Visual studio.
The problem was the subscription we were using has a firewall in place. So there was no way to get into firewall by even doing things like adding "WEBSITE_WEBDEPLOY_USE_SCM" = false in the app setting of web service.
The only solution we could think of was to create an agent inside a VM sitting inside the same firewall.
Recreate web app in Azure Portal -> Make sure target framework selected correctly.
I had accidentally set this to docker previously during my web app setup in the portal and this error was produced as well. I was using a MVC .NET 4.7 project and trying to use web deploy.
Hopefully this helps someone who has perhaps set up their web app incorrectly in the azure portal.

Production MobileFirst 7 Server upgrade from Worklight 6.2, Adapter call not working

We have a MobileFirst application that worked with Worklight 6.2 server - production also. We are using a http adapter: <connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
Currently we are changing the production server to 7.0.0. On Development Server we could test our application and all the functionalities were OK. We'we created the .war with the production server on build configuration and uploaded together with the android .wlapp . Now we receive 404 when the application tries to call any adapter function on production server. invokeProcedure onFailure returns UNEXPECTED_ERROR. This is with:
Server version: 7.0.0.00.20150312-0731
Project WAR version: 7.0.0.00.20150402-2001
Adapter name: XXXXX. Version: 7.0.0.00.20150402-2001
Application: XXXXX-android-0.9.7, Version: 7.0.0.00.20150402-2001
We have no security enabled in the application.
Is there something that must be enabled on Server in order to allow old type adapters call?
When we've tested with upgraded MobileFirst Development Studio 7.0.0.00.20150430 as development platform - same server version, and we got same 404 (Context not found), but there tries to connect with authorization/v1/clients/instance instead of /apps/services/api/XXXXX/android/query
Should a Server upgrade solve this problem? We've noticed that there are updates available.
The Server is on a https connection, but was same on WL 6.2.
By the description in the comments and the supplied messages.log, it is clear that you are attempting to use Application Authenticity Protection.
This feature worked in a certain way in v6.2 and it works in a different way in v6.3 and above.
From the comments it appears you are only adding the publickSigningKey - this is no longer enough.
See the updated Application Authenticity Protection tutorial for steps to follow: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/authentication-security/application-authenticity-protection/
General steps to follow:
Setup authenticationConfig.xml with the security test
Add the security test to the environment node in application-descriptor.xml
Add the publicSigningKey to the <publicSigningKey> element
Add the application package name <packageName> element
I believe you are missing step 4.
Note that you also able to now enable the Extended Authenticity mode; follow the instructions in the tutorial.
Note about step 3: obviously the same keystore used to generate the publicSigningKey must be used when you export the signed .apk file... otherwise there will be a mismatch and the authenticity challenge will fail.
In your authenticationConfig.xml, make sure you have the securityTest available (= not commented out like in the file you've supplied in the comments below.
In your application-descriptor.xml, you are missing the securityTest attribute in the Android environment element: <android version="0.9.9"> change to <android version="0.9.9" securityTest="customTests">

Deployer user does not have Access to the file

I Try to deploy a application using Microsoft Release Management for Visual Studio or better known as "InRelease". But i face unexpected Problems using the MSI-Deployer.
The deployment fails with the flowing error:
Setup.msi XXX139W8 10/1/2014 11:19:18 AM 00:00:00 Package location '\\Server\drop\Application\Build_20140930.5\Setup.msi' does not exist or Deployer user does not have access. Failed
First suggestion(incorrect Path) is not the case, i double checked that.
So why does my Deployer user not have access to my server? And how to fix that?
I tried out running the DeploymentAgent as Administrator, as Local Service adding XXX139W8$ permissions to the drop folder, running as domain user with admin rights on the drop folder.
Sadly the deployment agent is totally unreachable or the error mentioned above shows up.
Here are some system specs:
TFS and RM Server run on a Windows Server 2012 R2 with SQL Server Express 2012 Installed.
The client i am Working on uses the Release Management Client for Microsoft Visual Studio 2013
The Target Machine is a Windows 8.1.
The deployer user is defined in the MS Deployment Service, ensure that this account has access to your Drop folder. I give the domain\EVERYONE account read access to the drop folder so that anyone can read the data
I resolved this Problem.
The cause was that i specified a File as Package (quite confusing if you try to deploy a single msi file) but the Component should only specify a Folder "Package".
The deployment agent fails to access the Folder (Setup.msi) and fails with the error i showed above.
Then i wasted hours in trying to fix my access problem, because if i enter the "Package location" everything worked fine._.

Nuget Server returning 403's and 404's

I'm trying to host nuget on my Amazon EC2 VPS, and I'm having issues.
I've followed the instructions here ( Hosting your own NuGet Feeds )
I've read this thread ( NuGet: remote server returned an Error(403) Forbidden ) along the same lines.
I'm not running TFS
It "could" be a proxy issue, but I'm not entirely sure how to check.
My NuGet feed is located at http://nuget.infinitas.ws. You'll notice that both http://nuget.infinitas.ws/nuget/Packages and http://nuget.infinitas.ws/Packages are throwing errors.
Any help with this will be greatly appreciated.
You are probably running the NuGet.Server in a Web Site-project. Try to run it via an ASP.NET Web Application instead (in Visual Studio you can create one via File -> New -> Project -> ASP.NET Web Application)
Have you tried the latest version (1.5)?
The release notes include some changes related to proxy authentication:
Support for Proxies that require authentication
When using NuGet behind a proxy that requires authentication, NuGet will now prompt for proxy credentials. Entering credentials allows NuGet to connect to the remote repository.
I realize I'm a little late to the party but I've just spent a frustrating couple of hours with the same problem.
I found that switching the Application Pool from "Classic" to "Integrated" fixed the problem