Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-10933

V2 API fails when POSTing to create new repo, and username has underscores (BB-12004)

    XMLWordPrintable

Details

    Description

      {{curl -X POST -v -H "Content-Type: application/json" -u USER_NAME:PASSWORD https://api.bitbucket.org/2.0/repositories/USERNAME_WITHUNDERSCORE/REPONAME -d '

      {"scm": "git", "is_private": "true", "fork_policy": "no_public_ forks" }

      '}}

      * Adding handle: conn: 0x7fdaf1003a00
      * Adding handle: send: 0
      * Adding handle: recv: 0
      * Curl_addHandleToPipeline: length: 1
      * - Conn 0 (0x7fdaf1003a00) send_pipe: 1, recv_pipe: 0
      * About to connect() to api.bitbucket.org port 443 (#0)
      *   Trying 131.103.20.170...
      * Connected to api.bitbucket.org (131.103.20.170) port 443 (#0)
      * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
      * Server certificate: *.bitbucket.org
      * Server certificate: DigiCert SHA2 High Assurance Server CA
      * Server certificate: DigiCert High Assurance EV Root CA
      * Server auth using Basic with user 'oa_rcm'
      > POST /2.0/repositories/USER_NAME/REPO HTTP/1.1
      > Authorization: Basic AUTHSTUFFHERE
      > User-Agent: curl/7.30.0
      > Host: api.bitbucket.org
      > Accept: */*
      > Content-Type: application/json
      > Content-Length: 71
      > 
      * upload completely sent off: 71 out of 71 bytes
      < HTTP/1.1 500 INTERNAL SERVER ERROR
      * Server nginx/1.5.10 is not blacklisted
      < Server: nginx/1.5.10
      < Date: Tue, 27 Jan 2015 20:34:00 GMT
      < Content-Type: application/json; charset=utf-8
      < Content-Length: 107
      < Connection: keep-alive
      < X-Served-By: app22
      < X-Render-Time: 1.12154102325
      < Content-Language: en
      < X-Static-Version: dfe627631238
      < Vary: Authorization, Accept-Language, Cookie
      < X-Version: 918c87cf75a9
      < ETag: "35ac6909d977d5865ffdd17e9555ab27"
      < X-Request-Count: 448
      < X-Frame-Options: SAMEORIGIN
      < 
      * Connection BCLOUD-0 to host api.bitbucket.org left intact
      {"error": {"message": "&#x27;NoneType&#x27; object has no attribute &#x27;pk&#x27;", "id": "044ff98d276145af97e949871256b193"}}
      

      Same command works when no _ in the username.

      Attachments

        Activity

          People

            Unassigned Unassigned
            c0a28cef46af plumlee-oa
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: