# Slash in branch name in PR causing an error in a BitBucket pipeline

**URL:** <https://community.sonarsource.com/t/slash-in-branch-name-in-pr-causing-an-error-in-a-bitbucket-pipeline/13468>\
**Category:** SonarQube Cloud\
**Tags:** bitbucket, sonarqube-cloud\
**Created:** [August 22, 2019, 7:06pm UTC](https://community.sonarsource.com/t/slash-in-branch-name-in-pr-causing-an-error-in-a-bitbucket-pipeline/13468 "2019-08-22T19:06:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timothy\_Nott](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/timothy_nott/32/5934_2.png) [@Timothy\_Nott](https://community.sonarsource.com/u/Timothy_Nott)\
**Post date:** [August 22, 2019, 7:06pm UTC](https://community.sonarsource.com/t/slash-in-branch-name-in-pr-causing-an-error-in-a-bitbucket-pipeline/13468/1 "2019-08-22T19:06:19Z")

</div>

- versions used

Cloud and BitBucket pipeline

- error observed (wrap logs/code around triple quote ``` for proper formatting)

In the build setup step of the pipeline, we are getting:

```auto
<1s
+ umask 000
+ GIT_LFS_SKIP_SMUDGE=1 git clone --branch="feature_jaimelimon/ch1825/hiring-manager-should-receive-an-email-when" https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIR
Cloning into '/opt/atlassian/pipelines/agent/build'...
fatal: Remote branch feature_jaimelimon/ch1825/hiring-manager-should-receive-an-email-when not found in upstream origin

```

- steps to reproduce

Run the pipeline with a branch name that contains slashes. Our bitbucket-pipeline.yml file is:

```auto
image: node:10.15.3

clone:
  depth: full # SonarCloud scanner needs the full history to assign issues properly

definitions:
  caches:
    sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
  steps:
    - step: &build-test-sonarcloud
        name: Build, test and analyze on SonarCloud
        caches:
          - node
          - sonar
        script:
          - pipe: sonarsource/sonarcloud-scan:0.1.5
            variables:
              SONAR_TOKEN: ${SONAR_TOKEN}
              EXTRA_ARGS: '-Dsonar.test.inclusions=" **/testing/** ,**/*.test.js" -Dsonar.typescript.lcov.reportPaths=coverage/lcov.info'

pipelines:
  pull-requests:
    '**':
      - step: *build-test-sonarcloud

```

- potential workaround

We could change our branch names, but that would require a change in other systems.

---

<div class="post-metadata">

**Author:** ![mickaelcaro](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mickaelcaro/32/4147_2.png) [@mickaelcaro](https://community.sonarsource.com/u/mickaelcaro)\
**Post date:** [August 26, 2019, 8:22am UTC](https://community.sonarsource.com/t/slash-in-branch-name-in-pr-causing-an-error-in-a-bitbucket-pipeline/13468/2 "2019-08-26T08:22:31Z")

</div>

Hi,

Do you have any further logs for this ? Looks like is has nothing to do with SonarCloud IMO

Have you tried adding “refs/heads/” before your branch name ?

Thanks.  
Mickaël

---

<div class="post-metadata">

**Author:** ![aurelie](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/aurelie/32/849_2.png) [@aurelie](https://community.sonarsource.com/u/aurelie)\
**Post date:** [October 28, 2019, 2:05pm UTC](https://community.sonarsource.com/t/slash-in-branch-name-in-pr-causing-an-error-in-a-bitbucket-pipeline/13468/3 "2019-10-28T14:05:36Z")

</div>

3 posts were split to a new topic: [Invalid project key with Jenkins](https://community.sonarsource.com/t/invalid-project-key-with-jenkins/15969)
