Search code examples
google-app-engineasp.net-coregoogle-cloud-platformasp.net-core-2.1app-engine-flexible

Deploy ASP.NET Core 2.1 app to Google Cloud App Engine error: bad character range


When I try to publish an ASP.NET Core 2.1 Web Application to Google Cloud Platform App Engine I get the error gcloud crashed (error): bad character range.

I publish with the GCP Visual Studio 2017 extension and I get the above error.

I publish from the cmd with an app.yaml in my project and I get the above error.

In order to deploy the ASP.NET Core 2.1 web application to Google Cloud App Engine I added an app.yaml file with the following contents:

runtime: aspnetcore
env: flex

I did the following:

Added app.yaml with

runtime: aspnetcore
env: flex

Added it to csproj

 <ItemGroup>
    <None Include="app.yaml" CopyToOutputDirectory="Always" />
  </ItemGroup>

And executed the command

gcloud beta app deploy ./bin/release/netcoreapp2.1/publish/app.yaml

However I got the error: gcloud crashed (error): bad character range

Anyone know what I am doing wrong?

I follow the following guide and still get the same error when I try method 1, 2 and 3: https://cloudplatform.googleblog.com/2017/10/4-ways-you-can-deploy-an-ASP.NET-Core-app-to-GCP.html


Solution

  • This issue is being investigated at the moment and a fix should be released soon. As a workaround, please downgrade your Cloud SDK version to 212.0.0 by running the following command:

    gcloud components update --version 212.0.0

    Downgrading the version of your Cloud SDK to 212.0.0 or lower works because it seems in version 213.0.0 some changes were implemented that caused an issue with the yaml parser used by gcloud.

    In addition, please follow this Issue Tracker thread to get updates regarding the status of this issue.