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

TypeError: path must be string or Buffer - Deployment to azure #6535

Closed
Ruud-cb opened this issue Feb 26, 2018 · 5 comments
Closed

TypeError: path must be string or Buffer - Deployment to azure #6535

Ruud-cb opened this issue Feb 26, 2018 · 5 comments
Assignees
Labels
Area: AzureAppService Label to monitor Azure App Service issues Area: Release

Comments

@Ruud-cb
Copy link

Ruud-cb commented Feb 26, 2018

Environment

  • Server - VSTS or TFS on-premises?
    • If using VSTS, provide the account name, team project name, build definition name/build number:

Account: babywatcher. Team project name: Babywatcher, build definition name: Babywatcher-Production, build number 360 and 361, but more importantly Release 132, 133, 134, 135 (for production staging deployment)

  • Agent - Hosted or Private:

    • If using Hosted agent, provide agent queue name:

Using private for build (because of build issues on Hosted agent, but that is another issue), using Hosted agent for release. I have tried Hosted and Hosted VS2017 and private Agent, but it seems to be Agent version related.

Issue Description

Last successful release without changing properties/taks/settings: 2/21/2018 10:02 PM
Did 2 code changes this morning, both server-side related code (error is probably NPM related). Try to build and release as usual but got the error:

##[error]Error: TypeError: path must be a string or Buffer:
(here I have tried it on VS2017 Hosted agent, same result)
image
This is during deployment of a ASP.NET Core (2) web project, with using npm,angular for the front-end.

Error logs

NORMAL logs, when it went ok (Release 131 in my VSO), version was 3.3.36 of Agent

2018-02-21T22:02:59.1032571Z ##[section]Starting: Deploy Azure App Service - BBWProduction Webshop
2018-02-21T22:02:59.1040401Z ==============================================================================
2018-02-21T22:02:59.1041277Z Task         : Azure App Service Deploy
2018-02-21T22:02:59.1042206Z Description  : Update Azure WebApp Services On Windows, Web App On Linux with built-in images or docker containers, ASP.NET, .NET Core, PHP, Python or Node based Web applications, Function Apps, Mobile Apps, Api applications, Web Jobs using Web Deploy / Kudu REST APIs
2018-02-21T22:02:59.1043102Z Version      : 3.3.36
2018-02-21T22:02:59.1043616Z Author       : Microsoft Corporation
2018-02-21T22:02:59.1044181Z Help         : [More Information](https://aka.ms/azurermwebdeployreadme)
2018-02-21T22:02:59.1044813Z ==============================================================================
2018-02-21T22:03:01.6576531Z Got connection details for Azure App Service:'BBWProduction'
2018-02-21T22:03:02.6389879Z JSON variable substitution applied successfully.
2018-02-21T22:03:05.0248279Z [command]"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='D:\a\r1\a\temp_web_package_9127512340743229.zip' -dest:contentPath='BBWProduction',ComputerName='https://bbwproduction-stagingorder.scm.azurewebsites.net:443/msdeploy.axd?site=BBWProduction',UserName='********',Password='********',AuthType='Basic' -enableRule:DoNotDeleteRule -userAgent:VSTS_d236ae24-159b-4569-aee1-4046d38169ba_release_2_255_255_1
2018-02-21T22:03:07.5417991Z Info: Using ID 'c7e8e3bc-3359-4a78-9179-c7d270330dce' for connections to the remote server.
2018-02-21T22:03:23.9462075Z Info: Using ID '3c150a55-8717-4045-8626-4d7462ed57d9' for connections to the remote server.
2018-02-21T22:03:28.9252028Z Info: Updating file (BBWProduction\Adyen.EcommLibrary.dll).

Currently (v3.3.41):

2018-02-26T19:26:48.7635742Z ##[section]Starting: Deploy Azure App Service - BBWProduction Webshop
2018-02-26T19:26:48.7645117Z ==============================================================================
2018-02-26T19:26:48.7645773Z Task         : Azure App Service Deploy
2018-02-26T19:26:48.7646837Z Description  : Update Azure WebApp Services On Windows, Web App On Linux with built-in images or docker containers, ASP.NET, .NET Core, PHP, Python or Node based Web applications, Function Apps, Mobile Apps, Api applications, Web Jobs using Web Deploy / Kudu REST APIs
2018-02-26T19:26:48.7647719Z Version      : 3.3.41
2018-02-26T19:26:48.7649036Z Author       : Microsoft Corporation
2018-02-26T19:26:48.7649723Z Help         : [More Information](https://aka.ms/azurermwebdeployreadme)
2018-02-26T19:26:48.7650475Z ==============================================================================
2018-02-26T19:26:49.8567944Z Got connection details for Azure App Service:'BBWProduction'
2018-02-26T19:26:57.7297125Z JSON variable substitution applied successfully.
2018-02-26T19:27:00.0401075Z ##[error]Error: TypeError: path must be a string or Buffer
2018-02-26T19:27:01.0331741Z Successfully updated deployment History at https://bbwproduction-stagingorder.scm.azurewebsites.net/api/deployments/2591519673220658
2018-02-26T19:27:01.0608329Z ##[section]Finishing: Deploy Azure App Service - BBWProduction Webshop

@vincent1173
Copy link
Contributor

@Ruud-cb , Sorry for the issue you are facing. Can you please share the debug logs (set system.debug=true and rerun the release)?

@vincent1173 vincent1173 added the Area: AzureAppService Label to monitor Azure App Service issues label Feb 27, 2018
@Ruud-cb
Copy link
Author

Ruud-cb commented Feb 27, 2018

Hi @vincentdass

Here is a screenshot of the artifact, might be related:

image

Here is the log around the error:

2018-02-27T07:41:52.9265311Z ##[debug]System.DefaultWorkingDirectory=D:\a\r1\a
2018-02-27T07:41:52.9266414Z ##[debug]Archiving D:\a\r1\a\temp_web_package_7755679916024518 to D:\a\r1\a\temp_web_package_8184679796441483.zip
2018-02-27T07:41:55.2139214Z ##[debug]Successfully created archive D:\a\r1\a\temp_web_package_8184679796441483.zip
2018-02-27T07:41:55.2140699Z ##[debug]rm -rf D:\a\r1\a\temp_web_package_7755679916024518
2018-02-27T07:41:55.2141637Z ##[debug]removing directory
2018-02-27T07:41:55.2595950Z ##[debug]Performing the deployment of webapp.
2018-02-27T07:41:55.2866841Z ##[debug]SetParametersFile=D:\a\r1\a\Babywatcher-Production\ProductionDrop\Babywatcher.MVC_Package\Babywatcher.MVC.SetParameters.xml
2018-02-27T07:41:55.2869412Z ##[debug]Absolute path for pathSegments: D:\a\r1\a\Babywatcher-Production\ProductionDrop\Babywatcher.MVC_Package\Babywatcher.MVC.SetParameters.xml = D:\a\r1\a\Babywatcher-Production\ProductionDrop\Babywatcher.MVC_Package\Babywatcher.MVC.SetParameters.xml
2018-02-27T07:41:55.2871607Z ##[debug]build.sourcesDirectory=undefined
2018-02-27T07:41:55.2872754Z ##[debug]system.defaultWorkingDirectory=D:\a\r1\a
2018-02-27T07:41:55.2874526Z ##[debug]Absolute path for pathSegments: D:\a\r1\a = D:\a\r1\a
2018-02-27T07:41:55.2875584Z ##[debug]SetParametersFilepath supplied :true
2018-02-27T07:41:55.2876457Z ##[debug]System.DefaultWorkingDirectory=D:\a\r1\a
2018-02-27T07:41:55.2877480Z ##[debug]Exception tl.stats (undefined): TypeError: path must be a string or Buffer
2018-02-27T07:41:55.2878454Z ##[debug]task result: Failed
2018-02-27T07:41:55.2939809Z ##[error]Error: TypeError: path must be a string or Buffer
2018-02-27T07:41:55.2955492Z ##[debug]Processed: ##vso[task.issue type=error;]Error: TypeError: path must be a string or Buffer
2018-02-27T07:41:55.2957364Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: TypeError: path must be a string or Buffer
2018-02-27T07:41:55.2959020Z ##[debug][POST]https://management.azure.com/subscriptions/b0e103c5-56cf-46c8-9377-a1a45bf51918/resourceGroups/BBWShopAcceptance/providers/Microsoft.Web/sites/BBWProduction/slots/stagingorder/config/appsettings/list?api-version=2016-08-01
2018-02-27T07:41:55.8298662Z ##[debug]Application Insights is not configured for the App Service. Skipping adding release annotation.
2018-02-27T07:41:55.8304658Z ##[debug]build.sourceVersionAuthor=undefined
2018-02-27T07:41:55.8305972Z ##[debug]build.requestedfor=Ruud Faessen
2018-02-27T07:41:55.8307060Z ##[debug]build.buildUri=vstfs:///Build/Build/361
2018-02-27T07:41:55.8308383Z ##[debug]release.releaseUri=vstfs:///ReleaseManagement/Release/262
2018-02-27T07:41:55.8309373Z ##[debug]build.buildId=361
2018-02-27T07:41:55.8310668Z ##[debug]release.releaseId=262
2018-02-27T07:41:55.8311666Z ##[debug]build.buildNumber=361
2018-02-27T07:41:55.8312680Z ##[debug]release.releaseName=Release-138
2018-02-27T07:41:55.8315571Z ##[debug]system.teamProjectId=fd4398a5-f7e4-44d5-9c67-69478c4b3e42

Here is a download link to the full log, error occurs in first Deploy Azure App Service
https://www.dropbox.com/s/28iyfxfyhxbxf1r/ReleaseLogs_262.zip?dl=0

@vincent1173
Copy link
Contributor

@Ruud-cb , thanks for the debug logs.
We identified the cause of the issue and working on the fix.
As a workaround, Can you try the following steps:

  1. Enable 'Publish Using Deploy option'.
    image

  2. Remove the value from 'Set parameters file' input (if not required)

  3. Rerun the release.

@Ruud-cb
Copy link
Author

Ruud-cb commented Feb 27, 2018

@vincentdass Wow you actually gave me a hint there. I was a bit confused when I looked at the logs again, because Babywatcher-Production\ProductionDrop\Babywatcher.MVC_Package is not part of this deployment operation of this step, here I am deploying Babywatcher.Web (which is in temp_web_package_7755679916024518 in the logs). So the SetParameters file is not even needed.
I noticed when I checked the 'Publish using Web Deploy' that the value was already set, set to the 'SetParameters.xml' of the MVC application. This is due I have copied the step and adjusted according to the .Web project (which is a .NET Core web project)

After checking the option, removing the SetParamters file value (saving) and then unchecking the option again, the solution was actually fixed, it just released correctly.
The logs show it as well:

2018-02-27T08:53:31.5974337Z ##[debug]Archiving D:\a\r1\a\temp_web_package_4016622171673623 to D:\a\r1\a\temp_web_package_9619140527227481.zip
2018-02-27T08:53:33.6453728Z ##[debug]Successfully created archive D:\a\r1\a\temp_web_package_9619140527227481.zip
2018-02-27T08:53:33.6455216Z ##[debug]rm -rf D:\a\r1\a\temp_web_package_4016622171673623
2018-02-27T08:53:33.6456722Z ##[debug]removing directory
2018-02-27T08:53:33.6857624Z ##[debug]Performing the deployment of webapp.
2018-02-27T08:53:33.7141117Z ##[debug]SetParametersFile=D:\a\r1\a
2018-02-27T08:53:33.7143808Z ##[debug]Absolute path for pathSegments: D:\a\r1\a = D:\a\r1\a
2018-02-27T08:53:33.7144801Z ##[debug]build.sourcesDirectory=undefined
2018-02-27T08:53:33.7146286Z ##[debug]system.defaultWorkingDirectory=D:\a\r1\a
2018-02-27T08:53:33.7147951Z ##[debug]Absolute path for pathSegments: D:\a\r1\a = D:\a\r1\a
2018-02-27T08:53:33.7149254Z ##[debug]SetParametersFilepath supplied :false
2018-02-27T08:53:34.0601786Z ##[debug]Is the package an msdeploy package : false
2018-02-27T08:53:34.0606590Z ##[debug]AZURE_HTTP_USER_AGENT=VSTS_d236ae24-159b-4569-aee1-4046d38169ba_release_2_263_263_1
2018-02-27T08:53:34.0607871Z ##[debug]Constructed msDeploy comamnd line arguments
2018-02-27T08:53:34.0608960Z ##[debug]appservice.msdeployretrycount=undefined
2018-02-27T08:53:34.0611478Z ##[debug]System.DefaultWorkingDirectory=D:\a\r1\a
2018-02-27T08:53:34.0614670Z ##[debug]the argument string is:
2018-02-27T08:53:34.0617059Z ##[debug] -verb:sync -source:package="'D:\a\r1\a\temp_web_package_9619140527227481.zip'" -dest:contentPath="'BBWProduction'",ComputerName="'https://bbwproduction-stagingorder.scm.azurewebsites.net:443/msdeploy.axd?site=BBWProduction'",UserName="'$BBWProduction__stagingorder'",Password="'********'",AuthType="'Basic'" -enableRule:DoNotDeleteRule -userAgent:VSTS_d236ae24-159b-4569-aee1-4046d38169ba_release_2_263_263_1
2018-02-27T08:53:34.0619128Z ##[debug]converting the argument string into an array of arguments

Notice the 2018-02-27T08:53:33.7149254Z ##[debug]SetParametersFilepath supplied :false

So perhaps another thing to note: When 'Publish using Web Deploy` is NOT checked, the value of 'SetParameters file' should be empty (made empty or be taken as empty).

@vincent1173
Copy link
Contributor

@Ruud-cb , We have added check to ignore setparams and other inputs, when web-deploy is disabled.
Closing the thread as the issue is resolved. Fix will be available in upcoming deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: AzureAppService Label to monitor Azure App Service issues Area: Release
Projects
None yet
Development

No branches or pull requests

4 participants