"BAD REQUEST: Cannot execute ['/opt/vmware/vpostgres/1.0/bin/psql'" error while upgrading VCSA fails
search cancel

"BAD REQUEST: Cannot execute ['/opt/vmware/vpostgres/1.0/bin/psql'" error while upgrading VCSA fails

book

Article ID: 345492

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
  • Upgrading vCenter Server Appliance fails with the error: BAD REQUEST: Cannot execute ..
  • In the /var/log/vmware/upgrade.log file, you see entries similar to:

    <YYYY-MM-DD><time> INFO vcdb Configuring log folder paths in /var/log/vmware/upgrade
    <YYYY-MM-DD><time></time> INFO vcdb Retrieving DB type...
    </time>
    <YYYY-MM-DD><time></time> INFO vcdb DB type retrieved: PostgreSQL
    <YYYY-MM-DD><time></time> INFO vcdb Retrieving DB user...
    <YYYY-MM-DD><time></time> INFO vcdb DB user retrieved: vc
    <YYYY-MM-DD><time></time> INFO vcdb Retrieving DB password...
    <YYYY-MM-DD><time></time> INFO vcdb DB password retrieved: ****
    <YYYY-MM-DD><time></time> INFO vcdb Validating source embedded schema...
    <YYYY-MM-DD><time></time> INFO vcdb Souce embedded schema validation completed.
    <YYYY-MM-DD><time></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
    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></time> ERROR __main__ Upgrade Phase 'vcdb:CollectRequirements' failed. Exception:
    Traceback (most recent call last)

    Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.


Environment

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

Cause

This issue occurs when the installer searches for a database configuration in /opt/vmware/vpostgres/1.0/bin/psql instead of /opt/vmware/vpostgres/9.0.
 
Note: In vCenter server appliance 5.1 Update 1, database configuration is located at /opt/vmware/vpostgres/1.0/bin/psql. Starting with vCenter Server 5.1 Update 2, /opt/vmware/vpostgres/9.0 is used.

Resolution

This issue is resolved in vCenter Server Appliance 6.0 Update 3c, available at VMware Downloads.

To resolve this issue if you are unable to upgrade at this time, update the symbolic link to /opt/vmware/vpostgres/9.0.

Note: Create a backup of the vCenter Server Appliance database or take a snapshot of the vCenter Server Appliance.
  1. Navigate to the /opt/vmware/vpostgres directory:

    cd /opt/vmware/vpostgres
     
  2. Confirm the existing symbolic link by running this command:

    ls -al

    For example:

    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/


    The symbolic links should appear similar to:

    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. Run this command to correct the symbolic link:

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

    Note: The syntax for this command is ln -s target-filename symbolic-filename.
     
  4. Ensure the symbolic links are corrected by running the command:

    ls -al

    For example:
     
    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/


Additional Information


升级 vCenter Server Appliance 失败,并出现以下错误:无效请求: 无法执行 ['/opt/vmware/vpostgres/1.0/bin/psql
vCenter Server Appliance のアップグレードが次のエラーで失敗する:不正な要求です:['/opt/vmware/vpostgres/1.0/bin/psql を実行できません