Why am I getting a Travis CI error on my pull request to add a schema to a file?

349 views Asked by At

I am new to Github. I don't usually program, but I'm trying to do something for the Google Code-In here. I submitted a pull request with several changes to xsf/xeps on Github, but I'm getting an error with Travis CI. The end of the log with TCI looks like this:

unable to parse xep-0363.xml
make: *** [build/xep-0363.html] Error 6
The command "make all" exited with 2.
2.88s$ echo "lint,$(xmllint --nonet --noout --noent --loaddtd --valid *.xml 2>&1 | wc -l)" | ./git-ratchet check -v
INFO: 2016/12/18 20:33:55 check.go:12: Parsing measures from stdin
INFO: 2016/12/18 20:33:58 check.go:14: Finished parsing measures from stdin
INFO: 2016/12/18 20:33:58 check.go:15: [{lint 4279 4279}]
INFO: 2016/12/18 20:33:58 check.go:21: Reading measures stored in git
INFO: 2016/12/18 20:33:58 git.go:14: git --no-pager log --notes=git-ratchet-1-master --pretty=format:'%H,%ae,%at,"%N",' HEAD
INFO: 2016/12/18 20:33:58 check.go:50: Checking passed measure against stored value
INFO: 2016/12/18 20:33:58 git.go:14: git --no-pager log --notes=git-ratchet-excuse-1-master --pretty=format:'%N' 8930133cb12cef58730b70ca2abac6523b19b6a7^1..HEAD
INFO: 2016/12/18 20:33:58 reader.go:169: Total excuses []
INFO: 2016/12/18 20:33:58 reader.go:183: Checking measures: lint lint
ERROR: 2016/12/18 20:33:58 reader.go:209: Measure rising: lint, delta 3 (0.07015902712815715 percents)
FATAL: 2016/12/18 20:33:58 check.go:63: One or more metrics currently failing.
The command "echo "lint,$(xmllint --nonet --noout --noent --loaddtd --valid *.xml 2>&1 | wc -l)" | ./git-ratchet check -v" exited with 50.
Done. Your build exited with 1.

The The command "make all" exited with 2. and the The command "echo "lint,$(xmllint --nonet --noout --noent --loaddtd --valid *.xml 2>&1 | wc -l)" | ./git-ratchet check -v" exited with 50. lines were in red.

What's going on here?

Okay, I'm editing this to add that I've tried what @melpomene suggested in their answer below. However, I've tried to remove that line 4 times and then re-squashed the commits after, and it keeps re-appearing. How do I fix this?

1

There are 1 answers

1
melpomene On BEST ANSWER

According to the Travis configuration of that build:

{
  "addons": {
    "apt": {
      "packages": [
        "xsltproc",
        "libxml2-utils"
      ]
    }
  },
  "before_install": [
    "wget -O git-ratchet https://github.com/iangrunert/git-ratchet/releases/download/v0.3.1/linux_amd64_git-ratchet",
    "chmod +x git-ratchet",
    "git fetch https://github.com/xsf/xeps.git refs/notes/*:refs/notes/*"
  ],
  "script": [
    "make all",
    "echo \"lint,$(xmllint --nonet --noout --noent --loaddtd --valid *.xml 2>&1 | wc -l)\" | ./git-ratchet check -v"
  ],
  "language": "ruby",
  "group": "stable",
  "dist": "precise",
  "os": "linux"
}

... which comes straight from that repo's .travis.yml:

addons:
  apt:
    packages:
      - xsltproc
      - libxml2-utils
before_install:
  - wget -O git-ratchet https://github.com/iangrunert/git-ratchet/releases/download/v0.3.1/linux_amd64_git-ratchet
  - chmod +x git-ratchet
  - git fetch https://github.com/xsf/xeps.git refs/notes/*:refs/notes/*
script:
  - make all
  - echo "lint,$(xmllint --nonet --noout --noent --loaddtd --valid *.xml 2>&1 | wc -l)" | ./git-ratchet check -v

Someone has customized the build step by setting the script key.

The value of script is either a single shell command or a list of shell commands to be executed by travis. They're all run, but if any of them fails (by returning a non-zero exit status), the whole build counts as failed.

The red lines come from Travis, telling you which command failed and what its exit status was.

As for what those commands actually do and what the errors mean, that depends on the project. I'm not familiar with this one, but the last lines of output before the failure are:

xep-0363.xml:249: parser error : XML declaration allowed only at the start of the document    
 <?xml version='1.0' encoding='UTF-8'?>    
      ^    
xep-0363.xml:249: parser error : XML declaration allowed only at the start of the document    
 <?xml version='1.0' encoding='UTF-8'?>    
      ^    
unable to parse xep-0363.xml    
make: *** [build/xep-0363.html] Error 6

And indeed your commit introduces a <?xml ...?> line in the middle of a file, so that's probably what's breaking the build.