Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Pipeline failing all of a sudden. Python version issue.

Bruce Wilcox April 19, 2023

I know nothing about how python comes into play and how to set the version. Any help appreciated.

 

Getting error:

 

ERROR: Python 2 is not compatible with the Google Cloud SDK. Please use Python version 3.5 and up. If you have a compatible Python interpreter installed, you can use it by setting the CLOUDSDK_PYTHON environment variable to point to it.
Here is my pipelne;
branches:

master:

- step:

caches:

- maven

image: maven:3.8.1-openjdk-8

name: Build, stage, and deploy App Engine content

deployment: production

script:

- mvn -D skipTests=true -P useJfrog --settings settings.xml install appengine:stage

- mvn dependency:tree

- ls -la

- ls -la target/appengine-staging/app.yaml

- cat target/appengine-staging/app.yaml

- pipe: atlassian/google-app-engine-deploy:1.1.1

variables:

KEY_FILE: ${xxxx_SERVICE_ACCOUNT_KEY}

PROJECT: 'xxxx'

DEPLOYABLES: 'target/appengine-staging/app.yaml'

VERSION: 'xxxx-${BITBUCKET_BUILD_NUMBER}'

PROMOTE: 'true'

...

3 answers

1 accepted

0 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 20, 2023

Hello @Bruce Wilcox ,

Thank you for reaching out to Atlassian Community!

Could you share which exact command is throwing the Python version error? Was it a command of your step's script or was it the pipe atlassian/google-app-engine-deploy:1.1.1 ?

If it was the pipe, could you please include the DEBUG variable in the pipe definition and share the logs here with us? 

script:
  - pipe: atlassian/google-app-engine-deploy:1.1.1
    variables:
      <rest of your pipe variables>
      DEBUG: 'true'

Thank you, @Bruce Wilcox !

Patrik S

Bruce Wilcox April 20, 2023

Thanks for taking an interest in this.

The maven appengine:stage is failing all of a sudden:

mvn -D skipTests=true -P useJfrog --settings settings.xml package appengine:stage

Here is an excerpt from log:

[INFO] Staging the application to: /opt/atlassian/pipelines/agent/build/target/appengine-staging
[INFO] Detected App Engine appengine-web.xml based application.
Apr 20, 2023 7:15:25 PM com.google.cloud.tools.managedcloudsdk.install.Downloader download
INFO: Downloading https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz to /root/.cache/google-cloud-tools-java/managed-cloud-sdk/downloads/google-cloud-sdk.tar.gz
Welcome to the Google Cloud CLI!
WARNING: You appear to be running this script as root. This may cause
the installation to be inaccessible to users other than the root user.
ERROR: Python 2 is not compatible with the Google Cloud SDK. Please use Python version 3.5 and up.
If you have a compatible Python interpreter installed, you can use it by setting
the CLOUDSDK_PYTHON environment variable to point to it.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
Bruce Wilcox April 21, 2023

@Patrik S I have another Google App Engine project that uses Java 11 and Spring Boot and builds using image: maven:3.8.1-openjdk-11. It still builds and deploys successfully.

It appears that the "sudden" change is actually on the part of the Google CLI/SDK discontinuing support for Python 2.

I still think that Atlassian could provide a great service by recommending Docker images that work for the App Engine use cases.

Again, the steps that the pipeline needs to run back to back are:

script:
- mvn install appengine:stage
- pipe: atlassian/google-app-engine-deploy:1.1.1

I remain stuck and appreciate your help. 

Bruce Wilcox April 22, 2023

Docker image maven:3.8.3-openjdk-8 got me back up and running.

Like Patrik S likes this
0 votes
Nin Tran April 30, 2023

I use image maven:3.8.3-jdk-11 and it worked

0 votes
Christian James April 19, 2023

Hi Bruce,
To resolve this issue, you need to install Python 3.5 or higher and set the CLOUDSDK_PYTHON environment variable to point to the location of the Python 3.5 executable.

Heigo Varik April 20, 2023

Hi Christian, could you please direct me to an example on how to do that?

Bruce Wilcox April 20, 2023

How do I install Python on BitBucket cloud? 

Are you sure this is a valid answer?

 

Right now the pipeline is using Docker image: 

maven:3.8.1-openjdk-8

This image has maven, java 8, and Python 2.

What image has maven, java 8, and Python 3.5 or higher?

I wish the README.md at:

https://bitbucket.org/atlassian/google-app-engine-deploy/src/master/

would suggest images that work.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events