Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-8206

Crucible CLI tool does not work in a sym linked directory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Answered
    • Icon: Low Low
    • N/A
    • None
    • None

      Summary

      The Crucible.py CLI review creation tool throws an error when the client workspace containing a P4 repo is a sym link rather than a real path.

      Failed to get a patch. Please make sure to call the script from an SCM directory with local changes, or pipe in some input. – Error 

       
      If your "Root"(client root) within "p4 client" is set to a sym-linked directory, which is also the current directory, when running crucible.py, the below error is seen. If you return to the normal directory and change your "Root" back to the normal directory to match, no error is observed.

      Steps to Reproduce

      1. Set Client "Root" in "p4 client" to a sym-linked directory
      2. Run crucible.py from within the sym-linked dir

      Expected Results

      Root set to "/home/miwalker/fecru_training/p4_workspace" (real directory)
      ~/fecru_training/p4_workspace/repo1$ python crucible.py
      Crucible server: https://fecru.mycompany.com
      Crucible username: miwalker
      Please enter your Crucible password:
      Saved the default server URL https://fecru.mycompany.com to /home/miwalker/.atlassian/crucible.conf
      Saved an authentication token for https://fecru.mycompany.com to /home/miwalker/.atlassian/crucible.conf
      No matching FishEye repository detected
      Please choose a repository to anchor to, or press Enter to skip anchoring:
      Please specify a project to create the review in or an existing review id to add to [CR]:
      Please specify the review title:
      Please specify the review title:
      Please specify the review title: python cli testing
      Please specify a reviewer to be added to the review, or press Enter to continue:
      No reviewers added, review will be left in Draft state
      Created review CR-8 (state: Draft) - https://fecru.mycompany.com/cru/CR-8
      

      Actual Results

      Symlink info

      /home/miwalker/p4/repo1 -> /home/miwalker/fecru_training/p4_workspace/repo1//

      Python Version

      Python 2.7.12
      Root Set to "/home/miwalker/p4" (sym link path)
      ~/p4/repo1$ python crucible.py -d
      Crucible server: https://fecru.mycompany.com
      Crucible username: miwalker
      DEBUG:root:RestRequest: https://fecru.mycompany.com/rest-service-fecru/server-v1?FEAUTH=miwalker%3A2%3A++SANITIZED++ - {'Content-Type': 'application/json', 'Accept': 'application/json'} -  None
      DEBUG:root:RestResponse: {"timeZone":"America/Chicago","appHomeDir":"/opt/atlassian/fecru/4.5.3","appInstanceDir":"/var/atlassian/application-data/fecru","version":{"releaseNumber":"4.5.3","buildDate":"2018-03-21"},"isFishEye":true,"isCrucible":true}
      DEBUG:root:Connected successfully to https://fecru.mycompany.com - Crucible version 4.5.3
      DEBUG:root:RestRequest: https://fecru.mycompany.com/rest/review-cli/1.0/version/updateCheck?version=cd9734cfa42c09f1490da7f4f8b99d65&FEAUTH=miwalker%3A2%3A++SANITIZED++ - {'Content-Type': 'application/json', 'Accept': 'application/json'} -  None
      DEBUG:root:RestResponse: {"isUpdateAvailable":false,"latestVersion":"cd9734cfa42c09f1490da7f4f8b99d65"}
      DEBUG:root:Checking <class '__main__.FileSource'>.is_active
      DEBUG:root:Checking <class '__main__.StdInSource'>.is_active
      DEBUG:root:Checking <class '__main__.HgSource'>.is_active
      DEBUG:root:Checking <class '__main__.GitSource'>.is_active
      DEBUG:root:Checking <class '__main__.SvnSource'>.is_active
      DEBUG:root:Checking <class '__main__.CvsSource'>.is_active
      DEBUG:root:Trying to execute (['cvs', 'status'],)
      DEBUG:root:Error executing, exit code 1
      stdout=
      stderr=cvs status: No CVSROOT specified!  Please use the `-d' option
      cvs [status aborted]: or set the CVSROOT environment variable.
      
      DEBUG:root:Checking <class '__main__.P4Source'>.is_active
      DEBUG:root:Trying to execute (['p4'],)
      DEBUG:root:Finished executing, exit code 0
      stdout=
          Perforce -- the Fast Software Configuration Management System.
      
          p4 is Perforce's client tool for the command line.  Try:
      
              p4 help simple          list most common commands
              p4 help commands        list all standard commands
              p4 help command         help on a specific command
      
              p4 help administration  help on specialized administration topics
              p4 help charset         help on character set translation
              p4 help configurables   list server configuration variables
              p4 help environment     list environment and registry variables
              p4 help filetypes       list supported file types
              p4 help jobview         help on jobview syntax
              p4 help networkaddress  help on network address syntax
              p4 help revisions       help on specifying file revisions
              p4 help streamintro     introduction to streams
              p4 help usage           generic command line arguments
              p4 help views           help on view syntax
              p4 help replication     help on specialized replication topics
              p4 help dvcs            help on decentralized Perforce configurations
      
              p4 help legal           legal and license information
      
          The full user manual is available at
          https://www.perforce.com/support/self-service-resources/documentation
      
          Server 2018.1/1660568.
      
      
      stderr=
      DEBUG:root:Trying to execute (['p4', 'info'],)
      DEBUG:root:Finished executing, exit code 0
      stdout=User name: miwalker
      Client name: Atlassian-156
      Client host: Atlassian-156
      Client root: /home/miwalker/p4
      Current directory: /home/miwalker/p4/repo1
      Peer address: 127.0.0.1:45132
      Client address: 127.0.0.1
      Server address: localhost:1666
      Server root: .
      Server date: 2018/06/19 16:55:05 -0500 CDT
      Server uptime: 01:20:37
      Server version: P4D/LINUX26X86_64/2018.1/1660568 (2018/05/09)
      Server license: none
      Case Handling: sensitive
      
      stderr=
      DEBUG:root:p4info: {'Client name': 'Atlassian-156', 'Client root': '/home/miwalker/p4', 'Server version': 'P4D/LINUX26X86_64/2018.1/1660568 (2018/05/09)', 'Client address': '127.0.0.1', 'Server root': '.', 'Server uptime': '01:20:37', 'Server address': 'localhost:1666', 'User name': 'miwalker', 'Server license': 'none', 'Case Handling': 'sensitive', 'Current directory': '/home/miwalker/p4/repo1', 'Client host': 'Atlassian-156', 'Peer address': '127.0.0.1:45132', 'Server date': '2018/06/19 16:55:05 -0500 CDT'}
      Failed to get a patch. Please make sure to call the script from an SCM directory with local changes, or pipe in some input.
      

      Workaround

      Set Client Root back to real path and run crucible.py from real path

              Unassigned Unassigned
              miwalker Michael Walker
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: