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

BITBUCKET_REPO_OWNER_UUID must be of type string

michele_zangari July 2, 2020

Hi all,

i'm testing the use of this https://bitbucket.org/atlassian/bitbucket-clear-cache

to clear caches but i'm getting the said error when the pipeline runs.

Documentation says nothing about this as being needed, maybe i'm using it in the wrong way?

I've put the suggested code inside a "branch" triggered step that takes care of deployment to kubernetes clusters:

develop:
- step:
image: google/cloud-sdk:latest
name: Deploy to development
deployment: develop
script:
- pipe: atlassian/bitbucket-clear-cache:2.0.5
variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
CACHES: ["docker"]
..........

 NOTE: i'm a beginner :)

3 answers

0 votes
dlurth October 15, 2020

I got it to work by removing the beginning and ending braces from the BITBUCKET_REPO_OWNER_UUID and manually adding that variable to the pipe.

This ultimately did not fix my problem as it's still installing a composer dependencies from cache.

Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 16, 2020

@dlurth we are going to release fixed version next week. I will update you as soon as we release it.

Regards, Galyna

Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 16, 2020

Besides that, I want to say that it was not maintainable before, because it was not released : https://bitbucket.org/product/features/pipelines/integrations

Regards, Galyna

0 votes
Md_ Farhan Memon September 8, 2020

Hi @michele_zangari and @ktomk ,

I am facing the same issue. Tried with v2.0.1 but same error and for v1.0.1 it just fails at the start.

Any updates/fixes for successful build?

ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 8, 2020

Summon @Halyna Berezovska : Can you take a look, the bitbucket-clear-cache pipe appears to cause some usability problems at least. The variable (?) in the error seems undocumented.

@Md_ Farhan Memon Please also try with 2.0.5 if not yet. Just for double-checking with the latest release.

Md_ Farhan Memon September 8, 2020

Thanks @ktomk for the prompt response.

I started with v2.0.5 itself, it didn't work and landed on this question after some google search.

I tried other versions as you mentioned here but in vain.

michele_zangari September 10, 2020

Hi @Md_ Farhan Memon  and @ktomk 

unfortunately i wasn't able to succeed in using the clear cache pipe. Ended up discarding it for now since it is not vital to my needs. Hopefully this gets fixed though :) 

Thanks for help.

Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 15, 2020

@ktomk @Md_ Farhan Memon  @michele_zangari !

We did not release this pipe yet.

But we do have plans to work on that in near future.

Regards, Galyna

0 votes
ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 4, 2020

@michele_zangari Welcome!

Maybe you're doing it wrong but sometimes there are just integration/configuration issues so one thing to do first is to look into this.

Before the `- pipe: ....`  line, add another `- echo ...` line:

      script:
- echo "${BITBUCKET_REPO_OWNER_UUID}"
- pipe: atlassian/bitbucket-clear-cache:2.0.5

Running the pipeline with these changes should at least reveal what the value of the variable is. It should be automatically set IIRC which I think is the reason why this is not specifically documented with the pipe.

To further debug, you can expand the pipe entry in the pipeline output and it should show all the environment variables passed to the pipe (by name) in the command line arguments of the underlying `docker run` command.

michele_zangari July 6, 2020

Hi @ktomk and thanks for your reply.

I've added the echo instruction as suggested, and it actually outputs a valid UUID4 string in this form (note: this not the "real" UUID) :

{6a2f41a3-c54c-fce8-32d2-0324e1c32e22}

so is there any chance that the script might fail in recognizing this as a correct output?

Thanks for your help :)

ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 7, 2020

Well, from the error message I would say so that there is such kind of what is going on but on the other hand this does not match well b/c of the error message itself:

BITBUCKET_REPO_OWNER_UUID must be of type string

As your output shows, that is a string, perfectly fine.

Which triggers the question in me: Where exactly is that error message come from? Where is it displayed? That might shed some light.

michele_zangari July 13, 2020

Hey @ktomk , here it is the full stack trace when running the pipeline:


+ docker container run \
--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \
--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \
--volume=/usr/local/bin/docker:/usr/local/bin/docker:ro \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/bitbucket-clear-cache:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/bitbucket-clear-cache \
--workdir=$(pwd) \
--label=org.bitbucket.pipelines.system=true \
--env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \
--env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \
--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \
--env=BITBUCKET_PROJECT_UUID="$BITBUCKET_PROJECT_UUID" \
--env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \
--env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \
--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \
--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \
--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \
--env=BITBUCKET_PROJECT_KEY="$BITBUCKET_PROJECT_KEY" \
--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \
--env=CI="$CI" \
--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \
--env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \
--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \
--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \
--env=BITBUCKET_PIPELINE_UUID="$BITBUCKET_PIPELINE_UUID" \
--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \
--env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \
--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \
--env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \
--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \
--env=DOCKER_HOST="tcp://host.docker.internal:2375" \
--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \
--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/bitbucket-clear-cache" \
--env=BITBUCKET_APP_PASSWORD="$BITBUCKET_APP_PASSWORD" \
--env=BITBUCKET_USERNAME="$BITBUCKET_USERNAME" \
--env=CACHES_0="docker" \
--env=CACHES_COUNT="1" \
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
bitbucketpipelines/bitbucket-clear-cache:2.0.5
Unable to find image 'bitbucketpipelines/bitbucket-clear-cache:2.0.5' locally
2.0.5: Pulling from bitbucketpipelines/bitbucket-clear-cache
c499e6d256d6: Pulling fs layer
62b0f1bf7919: Pulling fs layer
30b7b8e6b50d: Pulling fs layer
f4947adccc3c: Pulling fs layer
219c07faa520: Pulling fs layer
20a186827ace: Pulling fs layer
8c9fd7ce3052: Pulling fs layer
1ad4a842aa57: Pulling fs layer
449b51ac1cb3: Pulling fs layer
f4947adccc3c: Waiting
219c07faa520: Waiting
20a186827ace: Waiting
8c9fd7ce3052: Waiting
1ad4a842aa57: Waiting
449b51ac1cb3: Waiting
62b0f1bf7919: Verifying Checksum
62b0f1bf7919: Download complete
f4947adccc3c: Verifying Checksum
f4947adccc3c: Download complete
219c07faa520: Verifying Checksum
219c07faa520: Download complete
30b7b8e6b50d: Verifying Checksum
30b7b8e6b50d: Download complete
20a186827ace: Verifying Checksum
20a186827ace: Download complete
c499e6d256d6: Verifying Checksum
c499e6d256d6: Download complete
1ad4a842aa57: Verifying Checksum
1ad4a842aa57: Download complete
8c9fd7ce3052: Verifying Checksum
8c9fd7ce3052: Download complete
449b51ac1cb3: Verifying Checksum
449b51ac1cb3: Download complete
c499e6d256d6: Pull complete
62b0f1bf7919: Pull complete
30b7b8e6b50d: Pull complete
f4947adccc3c: Pull complete
219c07faa520: Pull complete
20a186827ace: Pull complete
8c9fd7ce3052: Pull complete
1ad4a842aa57: Pull complete
449b51ac1cb3: Pull complete
Digest: sha256:8292a9277531772b4eab382a710881914e3d0fde9efd5ebf22a6174f46988fc5
Status: Downloaded newer image for bitbucketpipelines/bitbucket-clear-cache:2.0.5
[31m✖ Validation errors:
BITBUCKET_REPO_OWNER_UUID:
- must be of string type
ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2020

@michele_zangari Thanks for positing more information, in my eyes this looks more like a problem in the pipe than with your pipelines. Probably with version 2.0.1 it works and if it still does not work try with 1.0.1.

If you find a version that works, please post the version number.

michele_zangari July 23, 2020

Thanks @ktomk for the help, i'll try to test this in the next few days and get back with the results of using a different version.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events