Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: cocoapods-integration
    • Environment:
    • Similar Issues:

      Description

      This error occurred when I use CocoaPods Plugin and Xcode Plugin in Jenkins build job.

      Here is my steps,
      When I setup a build job, click build end got failure.
      Here is console log:

      Started by user Admin
      [EnvInject] - Loading node environment variables.
      Building in workspace /Users/Shared/Jenkins/Home/workspace/MyProject
       > git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
       > git config remote.origin.url git@github.com:xxxx/MyProject.git # timeout=10
      Fetching upstream changes from git@github.com:xxxx/MyProject.git
       > git --version # timeout=10
      using GIT_SSH to set credentials 
       > git fetch --tags --progress git@github.com:xxxx/MyProject.git +refs/heads/*:refs/remotes/origin/*
       > git rev-parse refs/remotes/origin/release_1^{commit} # timeout=10
       > git rev-parse refs/remotes/origin/origin/release_1^{commit} # timeout=10
      Checking out Revision dfb9556efc71ce4c5f7f714c385637560de16613 (refs/remotes/origin/master)
       > git config core.sparsecheckout # timeout=10
       > git checkout -f dfb9556efc71ce4c5f7f714c385637560de16613
       > git rev-list dfb9556efc71ce4c5f7f714c385637560de16613 # timeout=10
      [MyProject] $ touch Pods rm -r -f Pods pod repo update
      [MyProject] $ pod install
      Build step 'Update CocoaPods' marked build as failure
      Finished: FAILURE
      

      I login with jenkins account and see what happened during build.

      $ sudo su jenkins
      $ cd ~/workspace/MyProject
      

      Looking for files,

      $ ls -al
      -rw-r--r--    1 jenkins  jenkins     0 Dec 16 13:28 -f
      -rw-r--r--    1 jenkins  jenkins     0 Dec 16 13:28 -r
      drwxr-xr-x   17 jenkins  jenkins   578 Dec 16 14:28 .
      drwxr-xr-x    3 jenkins  jenkins   102 Dec 16 13:04 ..
      drwxr-xr-x   13 jenkins  jenkins   442 Dec 16 13:28 .git
      -rwxr-xr-x    1 jenkins  jenkins   378 Dec 16 13:04 .gitattributes
      -rwxr-xr-x    1 jenkins  jenkins  2948 Dec 16 13:04 .gitignore
      drwxr-xr-x  253 jenkins  jenkins  8602 Dec 16 13:04 MyProject
      drwxr-xr-x    3 jenkins  jenkins   102 Dec 16 13:04 MyProject.xcodeproj
      drwxr-xr-x    4 jenkins  jenkins   136 Dec 16 13:04 MyProjectTests
      drwxr-xr-x    4 jenkins  jenkins   136 Dec 16 13:04 MyProjectUITests
      -rw-r--r--    1 jenkins  jenkins  1295 Dec 16 13:04 Podfile
      -rwxr-xr-x    1 jenkins  jenkins    17 Dec 16 13:04 README.md
      -rw-r--r--    1 jenkins  jenkins     0 Dec 16 13:28 pod
      -rw-r--r--    1 jenkins  jenkins     0 Dec 16 13:28 repo
      -rw-r--r--    1 jenkins  jenkins     0 Dec 16 13:28 rm
      -rw-r--r--    1 jenkins  jenkins     0 Dec 16 13:28 update
      

      As you see, here has some weird files with length zero: -f, -r, pod, rm, update

      I manually do pod install and I got this,

      $ pod install
      
      ――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
      
      ### Command
      
      ```
      /usr/local/bin/pod install
      ```
      
      ### Report
      
      * What did you do?
      
      * What did you expect to happen?
      
      * What happened instead?
      
      
      ### Stack
      
      ```
         CocoaPods : 1.1.1
              Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
          RubyGems : 2.0.14.1
              Host : Mac OS X 10.12.1 (16B2555)
             Xcode : 8.1 (8B62)
               Git : git version 2.9.3 (Apple Git-75)
      Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
      Repositories :
      ```
      
      ### Plugins
      
      ```
      cocoapods-deintegrate : 1.0.1
      cocoapods-plugins     : 1.0.0
      cocoapods-search      : 1.0.0
      cocoapods-stats       : 1.0.0
      cocoapods-trunk       : 1.1.1
      cocoapods-try         : 1.1.0
      ```
      
      ### Podfile
      
      ```ruby
      # Uncomment this line to define a global platform for your project
      # platform :ios, '9.0'
      
      target 'MyProject' do
        # Comment this line if you're not using Swift and don't want to use dynamic frameworks
        use_frameworks!
      
        # Pods for MyProject
        pod 'Alamofire', '~> 4.0.1'
        pod 'Kingfisher', '~> 3.1.4'
        pod 'PromiseKit', '~> 4.0.4'
        pod 'AlamofireObjectMapper', '~> 4.0.0'
        pod 'GoogleAnalytics', '~> 3.17.0'
        pod 'CryptoSwift', '~> 0.6.5'
        pod 'Material', '~> 2.3.1'
        pod 'Localize-Swift', '~> 1.6'
        pod 'MXSegmentedPager', '~> 3.2.0'
        pod 'NVActivityIndicatorView', '~> 3.0'
        pod 'JDropdownMenu', :git => 'git@github.com:j796160836/MKDropdownMenu.git'
        pod 'Jukebox', :git => 'git@github.com:thanhcao/Jukebox.git', :commit => 'e8b4944000b5428356d95f21770a218ccd066f61'
        pod 'RxSwift', '~> 3.0.0'
        pod 'RxCocoa', '~> 3.0.0'
      
        use_frameworks!
        pod 'Fabric'
        pod 'Crashlytics'
      
        target 'MyProjectTests' do
          inherit! :search_paths
          # Pods for testing
        end
      
        target 'MyProjectUITests' do
          inherit! :search_paths
          # Pods for testing
        end
      end
      
      post_install do |installer|
          installer.pods_project.targets.each do |target|
              target.build_configurations.each do |config|
                  config.build_settings['SWIFT_VERSION'] = '3.0'
              end
          end
      end
      ```
      
      ### Error
      
      ```
      Errno::EEXIST - File exists - /Users/Shared/Jenkins/Home/workspace/MyProject/Pods
      /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir'
      /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
      /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p'
      /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each'
      /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p'
      /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `each'
      /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p'
      /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/sandbox.rb:58:in `initialize'
      /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/config.rb:184:in `new'
      /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/config.rb:184:in `sandbox'
      /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command.rb:113:in `installer_for_config'
      /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command/install.rb:34:in `run'
      /Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
      /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command.rb:50:in `run'
      /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/bin/pod:55:in `<top (required)>'
      /usr/local/bin/pod:23:in `load'
      /usr/local/bin/pod:23:in `<main>'
      ```
      
      ――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
      
      [!] Oh no, an error occurred.
      
      Search for existing GitHub issues similar to yours:
      https://github.com/CocoaPods/CocoaPods/search?q=File+exists+-+%2FUsers%2FShared%2FJenkins%2FHome%2Fworkspace%2FMyProject%2FPods&type=Issues
      
      If none exists, create a ticket, with the template displayed above, on:
      https://github.com/CocoaPods/CocoaPods/issues/new
      
      Be sure to first read the contributing guide for details on how to properly submit a ticket:
      https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
      
      Don't forget to anonymize any private data!
      
      Looking for related issues on cocoapods/cocoapods...
      Found no similar issues. To create a new issue, please visit:
      https://github.com/cocoapods/cocoapods/issues/new
      

      Obviously, It happened with this line
      [MyProject] $ touch Pods rm -r -f Pods pod repo update
      I also found some answer from internet, it might be the locale problem.
      http://stackoverflow.com/questions/35483344/eexist-file-exists-workspace-pods
      https://github.com/ThoughtsOnMobile/cocoapods-jenkins-integration/issues/4

      Can you fix this bug? Thanks.

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              j796160836 Johnny Sung
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: