Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BEFORE_SCRIPT does not work?: please upgrade python version 2.6 to 2.7 on jenkins #171

Closed
wkentaro opened this issue Oct 16, 2015 · 9 comments

Comments

@wkentaro
Copy link
Member

I have error because jenkins use python 2.6.

Successfully built multi-key-dict
Installing collected packages: pbr, multi-key-dict, six, python-jenkins
Successfully installed multi-key-dict pbr python-jenkins six
/opt/python/2.6.9/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
+++./.travis/travis_jenkins.py
/home/travis/.local/lib/python2.6/site-packages/jenkins/__init__.py:70: UserWarning: Support for python 2.6 is deprecated and will be removed.
  warnings.warn("Support for python 2.6 is deprecated and will be removed.")

TRAVIS_BRANCH        = master
TRAVIS_COMMIT        = f813bebc9a2fe16548b099e8c7736605f9ddb5af
TRAVIS_PULL_REQUEST  = 918
TRAVIS_REPO_SLUG     = start-jsk/jsk_apc
TRAVIS_BUILD_ID      = 85541722
TRAVIS_BUILD_NUMBER  = 1592
TRAVIS_JOB_ID        = 85541723
TRAVIS_JOB_NUMBER    = 1592.1
TRAVIS_BRANCH        = master
ROS_DISTRO       = indigo
ROSWS            = wstool
BUILDER          = catkin
USE_DEB          = false
EXTRA_DEB        = 
TEST_PKGS        = 
TARGET_PKGS       = 
BEFORE_SCRIPT      = wget https://raw.githubusercontent.com/Nanolx/patchimage/master/tools/gdown.pl -O jsk_2015_05_baxter_apc/test/gdown.pl; (cd jsk_2015_05_baxter_apc/test/; perl gdown.pl 'https://drive.google.com/uc?id=0B9P1L--7Wd2vTkdoUXAzdnVobWc' 2015-10-07-10-20-12_bin-box-array.bag)
NOT_TEST_INSTALL = 
ROS_PARALLEL_JOBS       = -j8
CATKIN_PARALLEL_JOBS    = 
ROS_PARALLEL_TEST_JOBS  = 
CATKIN_PARALLEL_TEST_JOBS = 
BUILD_PKGS       = 

Traceback (most recent call last):
  File "./.travis/travis_jenkins.py", line 283, in <module>
    TRAVIS_JENKINS_UNIQUE_ID='{}.{}'.format(TRAVIS_JOB_ID,time.time())
ValueError: zero length field name in format
+++exit 1
@k-okada
Copy link
Member

k-okada commented Oct 16, 2015

Why you have Python in /opt/?

◉ Kei Okada

2015/10/16 20:38、Kentaro Wada notifications@github.com のメッセージ:

I have error because jenkins use python 2.6.

Successfully built multi-key-dict
Installing collected packages: pbr, multi-key-dict, six, python-jenkins
Successfully installed multi-key-dict pbr python-jenkins six
/opt/python/2.6.9/lib/python2.6/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
+++./.travis/travis_jenkins.py
/home/travis/.local/lib/python2.6/site-packages/jenkins/init.py:70: UserWarning: Support for python 2.6 is deprecated and will be removed.
warnings.warn("Support for python 2.6 is deprecated and will be removed.")

TRAVIS_BRANCH = master
TRAVIS_COMMIT = f813bebc9a2fe16548b099e8c7736605f9ddb5af
TRAVIS_PULL_REQUEST = 918
TRAVIS_REPO_SLUG = start-jsk/jsk_apc
TRAVIS_BUILD_ID = 85541722
TRAVIS_BUILD_NUMBER = 1592
TRAVIS_JOB_ID = 85541723
TRAVIS_JOB_NUMBER = 1592.1
TRAVIS_BRANCH = master
ROS_DISTRO = indigo
ROSWS = wstool
BUILDER = catkin
USE_DEB = false
EXTRA_DEB =
TEST_PKGS =
TARGET_PKGS =
BEFORE_SCRIPT = wget https://raw.githubusercontent.com/Nanolx/patchimage/master/tools/gdown.pl -O jsk_2015_05_baxter_apc/test/gdown.pl; (cd jsk_2015_05_baxter_apc/test/; perl gdown.pl 'https://drive.google.com/uc?id=0B9P1L--7Wd2vTkdoUXAzdnVobWc' 2015-10-07-10-20-12_bin-box-array.bag)
NOT_TEST_INSTALL =
ROS_PARALLEL_JOBS = -j8
CATKIN_PARALLEL_JOBS =
ROS_PARALLEL_TEST_JOBS =
CATKIN_PARALLEL_TEST_JOBS =
BUILD_PKGS =

Traceback (most recent call last):
File "./.travis/travis_jenkins.py", line 283, in
TRAVIS_JENKINS_UNIQUE_ID='{}.{}'.format(TRAVIS_JOB_ID,time.time())
ValueError: zero length field name in format
+++exit 1

Reply to this email directly or view it on GitHub.

@wkentaro
Copy link
Member Author

I just added BEFORE_SCRIPT.
wkentaro/jsk_apc@9e2aede#diff-354f30a63fb0907d4ad57269548329e3R16

@k-okada
Copy link
Member

k-okada commented Oct 17, 2015

We do not need to check Python 2.6
http://www.ros.org/reps/rep-0003.html

@wkentaro
Copy link
Member Author

We do not need to check Python 2.6 http://www.ros.org/reps/rep-0003.html

I think the error is caused by BEFORE_SCRIPT because it fails before building the ROS system.
I will write test code for it later.

wkentaro added a commit to wkentaro/jsk_travis that referenced this issue Oct 17, 2015
wkentaro added a commit to wkentaro/jsk_travis that referenced this issue Oct 17, 2015
@wkentaro
Copy link
Member Author

I sent PR. #174
It fails even if I restart it.
https://travis-ci.org/jsk-ros-pkg/jsk_travis/jobs/85876272

Traceback (most recent call last):
  File "./.travis/travis_jenkins.py", line 279, in <module>
    j.reconfig_job(job_name, CONFIGURE_XML % locals())
  File "/home/travis/.local/lib/python2.7/site-packages/jenkins/__init__.py", line 879, in reconfig_job
    DEFAULT_HEADERS))
  File "/home/travis/.local/lib/python2.7/site-packages/jenkins/__init__.py", line 358, in jenkins_open
    e.code, e.msg)
jenkins.JenkinsException: Error in request. Possibly authentication failed [500]: Server Error

I doubt that BEFORE_SCRIPT='([shell command])' does not work, Because without '()' I had no error.
@k-okada do you have any idea?

If this is true, we can notice about this in README, and avoid to use () in BEFORE_SCRIPT.

@k-okada
Copy link
Member

k-okada commented Oct 18, 2015

i'm not confident on this but maybe we need to escape variable at
https://github.com/jsk-ros-pkg/jsk_travis/blob/master/travis_jenkins.py#L30
?

◉ Kei Okada

On Sat, Oct 17, 2015 at 5:19 PM, Kentaro Wada notifications@github.com
wrote:

I sent PR. #174 #174
It fails even if I restart it.
https://travis-ci.org/jsk-ros-pkg/jsk_travis/jobs/85876272

Traceback (most recent call last):
File "./.travis/travis_jenkins.py", line 279, in
j.reconfig_job(job_name, CONFIGURE_XML % locals())
File "/home/travis/.local/lib/python2.7/site-packages/jenkins/init.py", line 879, in reconfig_job
DEFAULT_HEADERS))
File "/home/travis/.local/lib/python2.7/site-packages/jenkins/init.py", line 358, in jenkins_open
e.code, e.msg)
jenkins.JenkinsException: Error in request. Possibly authentication failed [500]: Server Error

I doubt that BEFORE_SCRIPT='([shell command])' does not work, Because
without '()' I had no error.
@k-okada https://github.com/k-okada do you have any idea?

If this is true, we can notice about this in README, and avoid to use ()
in BEFORE_SCRIPT.


Reply to this email directly or view it on GitHub
#171 (comment)
.

@wkentaro wkentaro changed the title Please upgrade python version 2.6 to 2.7 on jenkins BEFORE_SCRIPT does not work?: please upgrade python version 2.6 to 2.7 on jenkins Oct 19, 2015
@wkentaro
Copy link
Member Author

it seems that && does not work.

@wkentaro
Copy link
Member Author

#177

@Naoki-Hiraoka
Copy link
Contributor

BEFORE_SCRIPT with character ' does not work on jenkins.

Example (caused error):
https://github.com/start-jsk/rtmros_gazebo/blob/26a9dd2d4ba8ee74dcf53d8fa8a6ce1caf7a6923/.travis.yml#L41

This is because BEFORE_SCRIPT is converted to string with ' in travis_jenkins.py.

-e BEFORE_SCRIPT='%(BEFORE_SCRIPT)s' \\

If you set BEFORE_SCRIPT in .travis.yml as

BEFORE_SCRIPT="echo 'hoge'"

, then travis_jenkins.py creates the job with

-e BEFORE_SCRIPT='echo 'hoge''

and this causes an error.

We have to avoid using ' and replace ' with " in .travis.yml like start-jsk/rtmros_gazebo@9ca04fa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants