GithubHelp home page GithubHelp logo

Comments (4)

CarstenGrohmann avatar CarstenGrohmann commented on June 2, 2024

The next build prints a shell error in the same function:

2023-02-07 08:40:18.856984 | TASK [Run wait_for_vcenter]
2023-02-07 08:40:19.196559 | controller | + server=https://vcenter.test
2023-02-07 08:40:19.196614 | controller | /tmp/wait_for_vcenter: line 4: vD: unbound variable
2023-02-07 09:32:15.201534 | controller | ERROR
2023-02-07 09:32:15.201757 | controller | {
2023-02-07 09:32:15.201806 | controller |   "attempts": 600,
2023-02-07 09:32:15.201841 | controller |   "delta": "0:00:00.003745",
2023-02-07 09:32:15.201872 | controller |   "end": "2023-02-07 09:32:15.163082",
2023-02-07 09:32:15.201903 | controller |   "msg": "non-zero return code",
2023-02-07 09:32:15.201933 | controller |   "rc": 1,
2023-02-07 09:32:15.201963 | controller |   "start": "2023-02-07 09:32:15.159337"
2023-02-07 09:32:15.201993 | controller | }

from ansible-zuul-jobs.

mariolenz avatar mariolenz commented on June 2, 2024

This is still a problem. When I look at the code:

- name: Prepare the wait for vcenter script
copy:
content: |
#!/bin/bash
set -eux
server='https://vcenter.test'
password="{{ lookup('file', '{{ zuul.executor.work_root }}/vcenter/tmp/vcenter_password.txt') }}"
session_id=$(curl -q --http1.1 -X POST -k -u "[email protected]:${password}" ${server}/rest/com/vmware/cis/session|jq -r .value)
ret=$(curl -k -H vmware-api-session-id:$session_id -X GET ${server}/api/vcenter/vm)
if [ "${ret}" = "[]" ]; then
echo "vCenter is ready"
exit 0
fi
exit 1
dest: "/tmp/wait_for_vcenter"
- name: Run wait_for_vcenter
command: "bash /tmp/wait_for_vcenter"
register: result
until: result is not failed
retries: 600

it looks like there is (sometimes) a problem preparing the wait for vCenter script. So the next tasks always runs with a broken script.

I'm not sure, but maybe this is a something to have a closer look at.

from ansible-zuul-jobs.

mariolenz avatar mariolenz commented on June 2, 2024

Might also be a problem with a special character in the password generated here:

#!/usr/bin/env python3
#
# Copyright 2019-2020 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import subprocess
import time
CHARACTER_BLACKLIST = ["\\", "'", '"', '%', '{', '}', ' ']
def set_new_pw():
p = subprocess.Popen(
['/usr/lib/vmware-vmdir/bin/vdcadmintool'],
bufsize=1024,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(child_stdin, child_stdout, child_stderr) = (p.stdin, p.stdout, p.stderr)
buff = ''
while True:
p.poll()
if p.returncode is not None:
break
line = child_stderr.read(1)
buff += line.decode()
if buff[-50:] == ' Get vmdir log level and mask\n==================\n\n':
buff = ''
child_stdin.write(b"3\n")
child_stdin.flush()
if buff[-50:] == ' Please enter account UPN : ':
child_stdin.write(b"[email protected]\n\n")
child_stdin.flush()
child_stdout.readline()
new_pw = child_stdout.readline()
return new_pw.decode().rstrip()
while True:
new_pw = set_new_pw()
found = [c for c in CHARACTER_BLACKLIST if c in new_pw]
if found:
time.sleep(0.1)
continue
print(new_pw)
exit(0)

from ansible-zuul-jobs.

mariolenz avatar mariolenz commented on June 2, 2024

It's not only /tmp/wait_for_vcenter: line 4: unexpected EOF while looking for matching ``'

At he moment, I see:

2023-11-15 17:51:39.257425 | TASK [Run wait_for_vcenter]
2023-11-15 17:51:39.767039 | controller | + server=https://vcenter.test
2023-11-15 17:51:39.767064 | controller | /tmp/wait_for_vcenter: line 4: unexpected EOF while looking for matching ``'
2023-11-15 17:53:06.997619 | TASK [Run wait_for_vcenter]
2023-11-15 17:53:07.623523 | controller | + server=https://vcenter.test
2023-11-15 17:53:07.623546 | controller | /tmp/wait_for_vcenter: line 4: go: unbound variable
2023-11-15 17:57:38.112009 | TASK [Run wait_for_vcenter]
2023-11-15 17:57:38.624401 | controller | + server=https://vcenter.test
2023-11-15 17:57:38.624443 | controller | /tmp/wait_for_vcenter: line 4: $7: unbound variable
2023-11-15 17:59:37.188995 | TASK [Run wait_for_vcenter]
2023-11-15 17:59:37.602070 | controller | + server=https://vcenter.test
2023-11-15 17:59:37.602162 | controller | /tmp/wait_for_vcenter: line 8: unexpected EOF while looking for matching `"'

from ansible-zuul-jobs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.