New issue
Advanced search Search tips

Issue 773542 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Franky bots are broken

Project Member Reported by sergeybe...@chromium.org, Oct 11 2017

Issue description

Both Mac and Linux bots fail with the same error:

[E2017-10-10T17:21:29.370163-07:00 2544 0 annotate.go:343] original error: strconv.Atoi: parsing "14+chromium14": invalid syntax
[E2017-10-10T17:21:29.370199-07:00 2544 0 annotate.go:343] 
[E2017-10-10T17:21:29.370208-07:00 2544 0 annotate.go:343] goroutine 1:
[E2017-10-10T17:21:29.370215-07:00 2544 0 annotate.go:343] #0 github.com/luci/luci-go/vpython/python/version.go:33 - python.ParseVersion.func1()
[E2017-10-10T17:21:29.370222-07:00 2544 0 annotate.go:343]   reason: "invalid number value: \"14+chromium14\""
[E2017-10-10T17:21:29.370229-07:00 2544 0 annotate.go:343]   "value" = "14+chromium14"
[E2017-10-10T17:21:29.370235-07:00 2544 0 annotate.go:343] 
[E2017-10-10T17:21:29.370243-07:00 2544 0 annotate.go:343] #1 github.com/luci/luci-go/vpython/python/version.go:48 - python.ParseVersion()
[E2017-10-10T17:21:29.370249-07:00 2544 0 annotate.go:343]   reason: "invalid patch value"
[E2017-10-10T17:21:29.370255-07:00 2544 0 annotate.go:343] 
[E2017-10-10T17:21:29.370261-07:00 2544 0 annotate.go:343] #2 github.com/luci/luci-go/vpython/python/interpreter.go:98 - python.parseVersionOutput()
[E2017-10-10T17:21:29.370267-07:00 2544 0 annotate.go:343]   reason: "failed to parse version from: \"2.7.14+chromium14\""
[E2017-10-10T17:21:29.370273-07:00 2544 0 annotate.go:343]   "value" = "2.7.14+chromium14"
[E2017-10-10T17:21:29.370281-07:00 2544 0 annotate.go:343] 
[E2017-10-10T17:21:29.370287-07:00 2544 0 annotate.go:343] #3 github.com/luci/luci-go/vpython/python/interpreter.go:79 - python.(*Interpreter).GetVersion()
[E2017-10-10T17:21:29.370292-07:00 2544 0 annotate.go:343] #4 github.com/luci/luci-go/vpython/python/find.go:48 - python.Find()
[E2017-10-10T17:21:29.370301-07:00 2544 0 annotate.go:343]   reason: "failed to get version for: \"/b/swarming/w/ir/cipd_bin_packages/bin/python2.7\""
[E2017-10-10T17:21:29.370307-07:00 2544 0 annotate.go:343]   "interp" = "/b/swarming/w/ir/cipd_bin_packages/bin/python2.7"
[E2017-10-10T17:21:29.370313-07:00 2544 0 annotate.go:343] 
[E2017-10-10T17:21:29.370319-07:00 2544 0 annotate.go:343] #5 github.com/luci/luci-go/vpython/venv/config.go:232 - venv.(*Config).resolvePythonInterpreter()
[E2017-10-10T17:21:29.370325-07:00 2544 0 annotate.go:343]   reason: "could not find Python for: 2.7.0"
[E2017-10-10T17:21:29.370332-07:00 2544 0 annotate.go:343]   "vers" = python.Version{Major:2, Minor:7, Patch:0}
[E2017-10-10T17:21:29.370338-07:00 2544 0 annotate.go:343] 
[E2017-10-10T17:21:29.370343-07:00 2544 0 annotate.go:343] #6 github.com/luci/luci-go/vpython/venv/config.go:174 - venv.(*Config).makeEnv()
[E2017-10-10T17:21:29.370352-07:00 2544 0 annotate.go:343]   reason: "failed to resolve system Python interpreter"
[E2017-10-10T17:21:29.370358-07:00 2544 0 annotate.go:343] 
[E2017-10-10T17:21:29.370363-07:00 2544 0 annotate.go:343] #7 github.com/luci/luci-go/vpython/venv/venv.go:119 - venv.getRuntimeEnvironment()
[E2017-10-10T17:21:29.370369-07:00 2544 0 annotate.go:343] #8 github.com/luci/luci-go/vpython/venv/venv.go:105 - venv.With()
[E2017-10-10T17:21:29.370375-07:00 2544 0 annotate.go:343]   reason: "failed to get runtime environment"
[E2017-10-10T17:21:29.370384-07:00 2544 0 annotate.go:343] 
[E2017-10-10T17:21:29.370389-07:00 2544 0 annotate.go:343] #9 github.com/luci/luci-go/vpython/run.go:89 - vpython.Run()
[E2017-10-10T17:21:29.370397-07:00 2544 0 annotate.go:343] #10 github.com/luci/luci-go/vpython/application/application.go:207 - application.(*Config).mainImpl()
[E2017-10-10T17:21:29.370403-07:00 2544 0 annotate.go:343] #11 github.com/luci/luci-go/vpython/application/application.go:225 - application.(*Config).Main.func1()
[E2017-10-10T17:21:29.370410-07:00 2544 0 annotate.go:343] #12 github.com/luci/luci-go/vpython/application/support.go:26 - application.run()
[E2017-10-10T17:21:29.370434-07:00 2544 0 annotate.go:343] #13 github.com/luci/luci-go/vpython/application/application.go:226 - application.(*Config).Main()
[E2017-10-10T17:21:29.370440-07:00 2544 0 annotate.go:343] #14 vpython/main.go:71 - main.mainImpl()
[E2017-10-10T17:21:29.370446-07:00 2544 0 annotate.go:343] #15 vpython/main.go:77 - main.main()
[E2017-10-10T17:21:29.370452-07:00 2544 0 annotate.go:343] #16 runtime/proc.go:185 - runtime.main()
[E2017-10-10T17:21:29.370460-07:00 2544 0 annotate.go:343] #17 runtime/asm_amd64.s:2197 - runtime.goexit()
step returned non-zero exit code: 1
 
This was originally observed on https://crrev.com/c/701926
An attempt to roll recipes manually didn't fix the issue: 
https://chromium-review.googlesource.com/c/chromium/src/tools/franky/+/710656/1

Running the tests locally works fine:

$ ./test.py run
[...]
All tests pass.

Cc: d...@chromium.org
Looked at it with vadimsh@, apparently it's a bug in vpython.

+dnj@ for help - any ideas? Thanks!
Some more context: the newly rolled python on bots reports its version as "2.7.14+chromium14". Curiously, adding this string to vpython tests in version parsing passes the tests. Yet, this fails on a bot.
The tests in franky are run using this script: https://chromium.googlesource.com/chromium/src/tools/franky/+/master/test.py
which has #!/usr/bin/env vpython
And the corresponding https://chromium.googlesource.com/chromium/src/tools/franky/+/master/test.py.vpython requests python "2.7" (without minor version), which in theory should still work (it worked before).

Comment 5 by d...@chromium.org, Oct 11 2017

Posting from chat:

Yes, that is it. You pin it here: https://chromium.googlesource.com/chromium/src/tools/franky/+/master/recipes/recipe_modules/franky/api.py
You actually don't need to do that anymore. LUCI builds have a system-managed "vpython" in PATH by default.

Oh actually you can do better with the recipe too. Another new thing:

self.m.python(
  'name',
  '/path/to/script',
  venv=True)

IMO:
1) Remove the init() bootstrap and just expect "vpython" in PATH.
2) Remove explicit call to "vpython" and replace with "venv=" python recipe module kwarg.

Developers running recipe would have to have "vpython" themselves, but depot_tools offers it. Without depot_tools, could just document as a dependency.

Comment 6 by d...@chromium.org, Oct 11 2017

Oh the actual problem: vpython used to have a parsing bug. It naively thought Python versions were straightforward, but they are not: https://chromium.googlesource.com/infra/luci/luci-go/+/0eb69ab195d7c4a88cd41d26b53f9a868c15713f

Actually due to me fixing that bug, I began (ab)using Python PEP440 liberties when versioning my generated Python bundles. Unfortunately, your "vpython" looks to be older than that fix, so you need to update it.

Alternatively (and preferentially), you can just not worry about "vpython" altogether and let LUCI hand it to you. We update the LUCI version periodically, and it is definitely several versions past that fix landing.
Great, thank you, Dan! I think I'll go with the self.m.python(venv=True) version, but will still keep vpython in the #! header, so ./test.py script can be run directly. It's easier for non-infra-savvy users this way.
Uploaded https://crrev.com/c/711060
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 11 2017

Status: Verified (was: Assigned)
Verified by CQ'ing https://crrev.com/c/701926 .

Sign in to add a comment