Failed to deploy because of ruby error

It seems like there are some wrong with dpl-pages instead of my config.

Job: https://travis-ci.org/joshuaavalon/cloudflare-ddns/jobs/461701889
Log:

/home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-pages-1.10.6/lib/dpl/provider/pages.rb:141:in `mkdir': File exists @ dir_s_mkdir - /tmp/d20181130-3845-gyh65z/work (Errno::EEXIST)
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-pages-1.10.6/lib/dpl/provider/pages.rb:141:in `github_pull_or_init'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-pages-1.10.6/lib/dpl/provider/pages.rb:195:in `block in push_app'
	from /home/travis/.rvm/rubies/ruby-2.4.5/lib/ruby/2.4.0/tmpdir.rb:89:in `mktmpdir'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-pages-1.10.6/lib/dpl/provider/pages.rb:190:in `push_app'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.6/lib/dpl/provider.rb:199:in `block in deploy'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.6/lib/dpl/cli.rb:41:in `fold'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.6/lib/dpl/provider.rb:199:in `deploy'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.6/lib/dpl/cli.rb:32:in `run'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.6/lib/dpl/cli.rb:7:in `run'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.6/bin/dpl:5:in `<top (required)>'
	from /home/travis/.rvm/gems/ruby-2.4.5/bin/dpl:23:in `load'
	from /home/travis/.rvm/gems/ruby-2.4.5/bin/dpl:23:in `<main>'

config

dist: xenial
language: python
python: 3.7
stages:
  - test
  - build
jobs:
  include:
    - stage: test
      name: flake8
      install:
        - travis_retry pip install -r requirements.txt
        - travis_retry pip install -U flake8
      script:
        - flake8 --version
        - flake8 cloudflare_ddns
        - flake8 run.py
    - stage: test
      name: pylint
      before_install:
        - deactivate
        - /opt/python/3.7.1/bin/python -m venv ~/venv
        - source ~/venv/bin/activate
      install:
        - travis_retry pip install -r requirements.txt
        - travis_retry pip install -U pylint
      script:
        - pylint --version
        - pylint cloudflare_ddns
        - pylint run.py
    - stage: build
      name: mkdocs
      if: branch = master
      install:
        - travis_retry pip install -U mkdocs mkdocs-material
      script:
        - mkdocs build
      deploy:
        provider: pages
        skip-cleanup: true
        github-token: $GITHUB_TOKEN
        keep-history: true
        local-dir: site
        on:
          branch: master
1 Like

Apparently, it only fail in Xenial. Switch to Trusty on deploy fixes the issue.

I have exactly the same error with gh-pages deployment after switching from Trusty to Xenial.
The issue arises when github repo does not yet have a target branch (e.g. gh-pages).

1 Like

So is there a better fix than switching back to Trusty?

Hello, there. Does it still happen with dpl 1.10.10? If so, please provide a relevant URL. Thanks.

Not sure of which version of dpl is being used but here is the logs links:
https://travis-ci.org/AppImage/libappimage/jobs/541477197#L890

Please let me know if you need something else.

The error is here

I think there is a logical failure; when git clone fails, it usually fails with the destination directory created and half populated. This results in the exception.

hey!

so what with that issue? can we fix it on dist: xenial?

Installing deploy dependencies
Successfully installed multipart-post-2.1.1
Successfully installed faraday-0.15.4
Successfully installed public_suffix-3.0.3
Successfully installed addressable-2.6.0
Successfully installed sawyer-0.8.2
Successfully installed octokit-4.6.2
Successfully installed dpl-pages-1.10.11
7 gems installed
Logged in as @daggerok (Maksim Kostromin)

Preparing deploy

Deploying application
/home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-pages-1.10.11/lib/dpl/provider/pages.rb:141:in `mkdir': File exists @ dir_s_mkdir - /tmp/d20190616-8171-g9thkk/work (Errno::EEXIST)
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-pages-1.10.11/lib/dpl/provider/pages.rb:141:in `github_pull_or_init'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-pages-1.10.11/lib/dpl/provider/pages.rb:195:in `block in push_app'
	from /home/travis/.rvm/rubies/ruby-2.4.5/lib/ruby/2.4.0/tmpdir.rb:89:in `mktmpdir'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-pages-1.10.11/lib/dpl/provider/pages.rb:190:in `push_app'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.11/lib/dpl/provider.rb:199:in `block in deploy'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.11/lib/dpl/cli.rb:41:in `fold'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.11/lib/dpl/provider.rb:199:in `deploy'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.11/lib/dpl/cli.rb:32:in `run'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.11/lib/dpl/cli.rb:7:in `run'
	from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.11/bin/dpl:5:in `<top (required)>'
	from /home/travis/.rvm/gems/ruby-2.4.5/bin/dpl:23:in `load'
	from /home/travis/.rvm/gems/ruby-2.4.5/bin/dpl:23:in `<main>'
failed to deploy

see https://travis-ci.org/daggerok/sbt-examples/builds/546408881#L987