升级 vCenter Server Appliance 失败,并出现以下错误:无效请求: 无法执行 ['/opt/vmware/vpostgres/1.0/bin/psql
search cancel

升级 vCenter Server Appliance 失败,并出现以下错误:无效请求: 无法执行 ['/opt/vmware/vpostgres/1.0/bin/psql

book

Article ID: 342775

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
免责声明:本文为 Upgrading vCenter Server Appliance fails with the error: BAD REQUEST: Cannot execute ['/opt/vmware/vpostgres/1.0/bin/psql (2142954) 的翻译版本。尽管我们会不断努力为本文提供最佳翻译版本,但本地化的内容可能会过时。有关最新内容,请参见英文版本。

  • 升级 vCenter Server Appliance 失败。
  • /var/log/vmware/upgrade.log 文件中,您会看到类似以下内容的消息:

    <YYYY-MM-DD><time> INFO vcdb Configuring log folder paths in /var/log/vmware/upgrade
    <YYYY-MM-DD><time>INFO vcdb Retrieving DB type...
    </time></time>
    <YYYY-MM-DD><time>INFO vcdb DB type retrieved: PostgreSQL</time>
    <YYYY-MM-DD><time>INFO vcdb Retrieving DB user...</time>
    <YYYY-MM-DD><time>INFO vcdb DB user retrieved: vc</time>
    <YYYY-MM-DD><time>INFO vcdb Retrieving DB password...</time>
    <YYYY-MM-DD><time>INFO vcdb DB password retrieved: ****</time>
    <YYYY-MM-DD><time>INFO vcdb Validating source embedded schema...</time>
    <YYYY-MM-DD><time>INFO vcdb Souce embedded schema validation completed.</time>
    <YYYY-MM-DD><time>WARNING transport.local BAD REQUEST: Cannot execute ['/opt/vmware/vpostgres/1.0/bin/psql', '-U', 'postgres', '-d', 'VCDB', '-t', '-c', "\n SELECT ceil(sum(pg_relation_size(C.oid)) / (1024*1024)) as</time>
    disk_size\n FROM pg_class C\n LEFT JOIN pg_namespace N\n ON N.oid = C.relnamespace\n WHERE nspname IN ('vc', 'vpx') and relkind in ('r', 't')\n \n
    AND relname NOT LIKE 'vpx_hist_stat%'\n AND relname NOT LIKE 'vpx_sample_time%'\n AND relname NOT LIKE 'vpx_event%'\n AND relname NOT LIKE 'vpx_
    task%'\n AND relname NOT LIKE 'vpx_property_bulletin%'\n "]. Error: [Errno 2] No such file or directory
    <YYYY-MM-DD><time>ERROR __main__ Upgrade Phase 'vcdb:CollectRequirements' failed. Exception:</time>
    Traceback (most recent call last)



Environment

VMware vCenter Server Appliance 5.5.x
VMware vCenter Server Appliance 6.0.x
VMware vCenter Server Appliance 5.1.x

Cause

安装程序从 /opt/vmware/vpostgres/1.0/bin/psql而不是/opt/vmware/vpostgres/9.0 搜索数据库配置时会出现此问题。

注意:vCenter Server Appliance 5.1 U1 使用路径 /opt/vmware/vpostgres/1.0/bin/psql。vCenter Server 5.1 U2 之后的版本使用 /opt/vmware/vpostgres/9.0。

Resolution

要解决此问题,需要将符号链接更新为 /opt/vmware/vpostgres/9.0

注意:创建 vCenter Server Appliance 数据库的备份或生成 vCenter Server Appliance 的快照。
  1. 导航到 opt/vmware/vpostgres 目录:

    cdopt/vmware/vpostgres

  2. 通过运行以下命令确认现有的符号链接:

    ls -al

    例如:

    drwxr-xr-x 4 root root 4096 Nov 21 2014 ./
    drwxr-xr-x 12 root root 4096 Apr 1 04:22 ../
    drwxr-xr-x 4 root root 4096 Nov 21 2014 1.0/
    drwxr-xr-x 7 root root 4096 Nov 21 2014 9.0/
    lrwxrwxrwx 1 root root 3 Nov 21 2014 current -> 9.0/

    符号链接应类似于:

    drwxr-xr-x 4 root root 4096 Nov 21 2014 1.0/ -> 9.0
    drwxr-xr-x 7 root root 4096 Nov 21 2014 9.0/ -> 1.0
    lrwxrwxrwx 1 root root 3 Nov 21 2014 current -> 9.0/

  3. 运行以下命令以更正符号链接:

    ln -s /opt/vmware/vpostgres/9.0 /opt/vmware/vpostgres/1.0

    注意:此命令的语法为 ln -starget-filenamesymbolic-filename


  4. 确保符号链接已更正:

    ls -al

    例如:

    drwxr-xr-x 4 root root 4096 Nov 21 2014 1.0/ -> 9.0
    drwxr-xr-x 7 root root 4096 Nov 21 2014 9.0/ -> 1.0
    lrwxrwxrwx 1 root root 3 Nov 21 2014 current -> 9.0/

  5. 再次运行 vCenter Server Appliance 升级。


Additional Information

Upgrading vCenter Server Appliance fails with the error: BAD REQUEST: Cannot execute ['/opt/vmware/vpostgres/1.0/bin/psql