hexadecimal value 0x00, is an invalid character. Line 2, position 1

Jimmy Afflick 100 Reputation points
2024-11-07T14:28:11.7+00:00

VbrAnswerFile_install.txt

Hi Experts,

We are running an PowerShell comment in that PowerShell comment we are calling the XML file and trying to install veeam software. I am getting an error like "hexadecimal value 0x00, is an invalid character. Line 2, position 1." Could someone please kindly help me to fix this issue. We have no idea about that.

I have attached the XML file below. I am looking forward to hearing from you.

<?xml version="1.0" encoding="utf-8"?>
<unattendedInstallationConfiguration bundle="Vbr" mode="install" version="1.0">
<!--[Required] Parameter 'mode' defines installation mode that silent install should operate in-->    
<!--Supported values: install/upgrade/uninstall-->
<!--Note: unused [Optional] parameters should be removed from the answer file-->
	<properties>
		<!--License agreements-->
		<!--Specify parameters to accept all the license agreements during silent installation or upgrade-->
			<!--[Required] Parameter ACCEPT_EULA specifies if you want to accept the Veeam license agreement. Specify '1' to accept the license agreement and proceed with installation or upgrade-->
				<!--Supported values: 0/1-->
				<property name="ACCEPT_EULA" value="1" />
			<!--[Required] Parameter ACCEPT_LICENSING_POLICY specifies if you want to accept Veeam licensing policy. Specify '1' to accept the licensing policy and proceed with installation or upgrade-->
				<!--Supported values: 0/1-->
				<property name="ACCEPT_LICENSING_POLICY" value="1" />
			<!--[Required] Parameter ACCEPT_THIRDPARTY_LICENSES specifies if you want to accept all the 3rd party licenses used. Specify '1' to accept the license agreements and proceed with installation or upgrade-->
				<!--Supported values: 0/1-->
				<property name="ACCEPT_THIRDPARTY_LICENSES" value="1" />
			<!--[Required] Parameter ACCEPT_REQUIRED_SOFTWARE specifies if you want to accept all the required software licenses. Specify '1' to accept the license agreements and proceed with installation or upgrade-->
				<!--Supported values: 0/1-->
				<property name="ACCEPT_REQUIRED_SOFTWARE" value="1" />
		<!--License file-->
		<!--Specify path to a license file and autoupdate option-->
			<!--[Optional] Parameter VBR_LICENSE_FILE specifies a full path to the license file. If you do not specify this parameter(or leave it empty value), Veeam Backup & Replication will be installed using current license file. To install Community Edition it must be set to 0-->
				<!--Supported values: file path/0(to install CE)-->    
				<property name="VBR_LICENSE_FILE" value="C:\Provision\Install\IMS\VeeamInstall\Veeam-32sockets-backup-ent-perpetual.lic" />
			<!--[Optional] Parameter VBR_LICENSE_AUTOUPDATE specifies if you want to update license automatically(enables usage reporting). If you do not specify this parameter, autoupdate will be enabled. For Community Edition, NFR and Evaluation licenses it must be set to 1. For licenses without license ID information it must be set to 0-->
				<!--Supported values: 0/1-->
				<property name="VBR_LICENSE_AUTOUPDATE" value="0" />
		<!--Service account-->
			<!--[Optional] Parameter VBR_SERVICE_USER specifies the account under which the Veeam Backup Service will run after installation and upgrade. If you do not specify this parameter, the Veeam Backup Service will run under the LocalSystem account-->
				<!--Supported values: domain\username-->
				<property name="VBR_SERVICE_USER" value="User2" />
			<!--[Optional] Parameter VBR_SERVICE_PASSWORD specifies a password for the account under which the Veeam Backup Service will run. You must specify this parameter together with VBR_SERVICE_USER parameter during installation. Required during upgrade if service account is not LocalSystem account-->
			<!--Make sure you keep the answer file in a safe location whenever service account password is added to the answer file-->
				<!--Supported values: password in plain text-->
				<property name="VBR_SERVICE_PASSWORD" value="Welcome@1234" hidden="1" />
		<!--Database configuration-->
		<!--Specify database server installation options and required configuration parameters for Veeam Backup & Replication database-->
			<!--[Required] Parameter VBR_SQLSERVER_INSTALL specifies if bundled PostgreSQL server will be installed. If set to '0', an existing SQL server settings must be specified below-->
				<!--Supported values: 0/1-->
				<property name="VBR_SQLSERVER_INSTALL" value="1" />
			<!--[Optional] Parameter VBR_SQLSERVER_ENGINE specifies SQL server type: '1' for PostgreSQL server, '0' for Microsoft SQL server.  Required when VBR_SQLSERVER_INSTALL is set to '0'-->
				<!--Supported values: 0/1-->
				<property name="VBR_SQLSERVER_ENGINE" value="1" />
			<!--[Optional] Parameter VBR_SQLSERVER_SERVER specifies a SQL server and instance on which the configuration database will be deployed. Required when VBR_SQLSERVER_INSTALL is set to '0'-->
				<!--Supported values: MSSQLSERVER\DBINSTANCE or POSTGRESQLSERVER:PORT-->
				<property name="VBR_SQLSERVER_SERVER" value="localhost:5432" />
			<!--[Optional] Parameter VBR_SQLSERVER_DATABASE specifies a name for the configuration database. If you do not specify this parameter, default name 'VeeamBackup' is used-->
				<!--Supported values: database name-->
				<property name="VBR_SQLSERVER_DATABASE" value="VeeamBackup" />
			<!--[Optional] Parameter VBR_SQLSERVER_AUTHENTICATION specifies authentication mode to connect to the database server where the Veeam Backup & Replication configuration database is deployed. Required when VBR_SQLSERVER_INSTALL is set to '0'-->
				<!--Supported values: 0 for Windows authentication/1 for SQL native authentication-->
				<property name="VBR_SQLSERVER_AUTHENTICATION" value="0" />
			<!--[Optional] Parameter VBR_SQLSERVER_USERNAME specifies a LoginID to connect to the SQL server in the native authentication mode. Required when VBR_SQLSERVER_AUTHENTICATION is set to '1'-->
				<!--Supported values: username-->
				<property name="VBR_SQLSERVER_USERNAME" value="User2" />
			<!--[Optional] Parameter VBR_SQLSERVER_PASSWORD specifies a password to connect to the SQL server in the native authentication mode. Required when VBR_SQLSERVER_USERNAME is used-->
			<!--Make sure you keep the answer file in a safe location whenever SQL server account password is added to the answer file-->
				<!--Supported values: password in plain text-->
				<property name="VBR_SQLSERVER_PASSWORD" value="Welcome@1234" hidden="1"/>
		<!--Ports configuration-->
		<!--Specify Veeam Backup & Replication used ports configuration-->
			<!--[Optional] Parameter VBRC_SERVICE_PORT specifies a TCP port that will be used by the Veeam Guest Catalog Service. If you do not specify this parameter, default port '9393' is used-->
				<!--Supported values: port-->            
				<property name="VBRC_SERVICE_PORT" value="9393" />
			<!--[Optional] Parameter VBR_SERVICE_PORT specifies a TCP port that will be used by the Veeam Backup Service. If you do not specify this parameter, default port '9392' is used. If specified port number is occupied already, setup will assign the next available port number to the component-->
				<!--Supported values: port-->            
				<property name="VBR_SERVICE_PORT" value="9392" />
			<!--[Optional] Parameter VBR_SECURE_CONNECTIONS_PORT specifies a port used for communication between the mount server and the backup server. If you do not specify this parameter, default port '9401' is used-->
				<!--Supported values: port-->                        
				<property name="VBR_SECURE_CONNECTIONS_PORT" value="9401" />
			<!--[Optional] Parameter VBR_RESTSERVICE_PORT specifies a port used for Veeam REST API service. If you do not specify this parameter, default port '9419' is used-->
				<!--Supported values: port-->            
				<property name="VBR_RESTSERVICE_PORT" value="9419" />
		<!--Data locations-->
		<!--Specify Veeam Backup & Replication installation path, catalog and cache folders location-->
			<!--[Optional] Parameter INSTALLDIR specifies Veeam Backup & Replication server installation path. If you do not specify this parameter, default installation path '%ProgramFiles%\Veeam\Backup and Replication' is used-->
				<!--Supported values: file path-->
				<property name="INSTALLDIR" value="C:\Program Files\Veeam\Backup and Replication" />
			<!--[Optional] Parameter VM_CATALOGPATH specifies a path to the catalog folder where index files will be stored. If you do not specify this parameter, a path is selected based on the free space across all available disks-->
				<!--Supported values: file path-->
				<property name="VM_CATALOGPATH" value="C:\VBRCatalog" />
			<!--[Optional] Parameter VBR_IRCACHE specifies the folder where instant recovery cache will be stored. If you do not specify this parameter, a path is selected based on the free space across all available disks-->
				<!--Supported values: file path-->
				<property name="VBR_IRCACHE" value="C:\ProgramData\Veeam\Backup\IRCache" />
		<!--Automatic update settings-->
		<!--Specify Veeam Backup & Replication autoupdate settings-->
			<!--[Optional] Parameter VBR_CHECK_UPDATES specifies if you want Veeam Backup & Replication to automatically check for new product versions and updates. If you do not specify this parameter, Veeam Backup & Replication will automatically check and notify about available updates and patches-->
				<!--Supported values: 0/1-->
				<property name="VBR_CHECK_UPDATES" value="0" />
		<!--Plug-ins for Veeam Backup & Replication-->
		<!--Specify additional components to install-->
			<!--[Optional] Parameter AHV_INSTALL specifies if Nutanix AHV Plug-in for Veeam Backup & Replication will be installed. If you do not specify this parameter, plug-in will not be installed-->
				<!--Supported values: 0/1-->            
				<property name="AHV_INSTALL" value="1" />
			<!--[Optional] Parameter RHV_INSTALL specifies if Red Hat Virtualization Plug-in for Veeam Backup & Replication will be installed. If you do not specify this parameter, plug-in will not be installed-->
				<!--Supported values: 0/1-->
				<property name="RHV_INSTALL" value="1" />
			<!--[Optional] Parameter AWS_INSTALL specifies if AWS Plug-in for Veeam Backup & Replication will be installed. If you do not specify this parameter, plug-in will be installed-->
				<!--Supported values: 0/1-->
				<property name="AWS_INSTALL" value="1" />
			<!--[Optional] Parameter AZURE_INSTALL specifies if Microsoft Azure Plug-in for Veeam Backup & Replication will be installed. If you do not specify this parameter, plug-in will be installed-->
				<!--Supported values: 0/1-->
				<property name="AZURE_INSTALL" value="1" />
			<!--[Optional] Parameter GCP_INSTALL specifies if Google Cloud Plug-in for Veeam Backup & Replication will be installed. If you do not specify this parameter, plug-in will be installed-->
				<!--Supported values: 0/1-->
				<property name="GCP_INSTALL" value="1" />
			<!--[Optional] Parameter KASTEN_INSTALL specifies if Kasten K10 Plug-in for Veeam Backup & Replication will be installed. If you do not specify this parameter, plug-in will be installed-->
				<!--Supported values: 0/1-->
				<property name="KASTEN_INSTALL" value="1" />
		<!--Setup settings-->
		<!--Specify additional setup settings-->
			<!--[Optional] Parameter REBOOT_IF_REQUIRED forces target server reboot, whenever it is required. If you do not specify this parameter, reboot is not performed automatically. Keep in mind that setup procedure will not be restarted after reboot-->
				<!--Supported values: 0/1-->
				<property name="REBOOT_IF_REQUIRED" value="0" />
	</properties>
</unattendedInstallationConfiguration>

Error:

<?xml version="1.0" encoding="utf-16"?> <unattendedInstallationResult> <events> <event id="113" title="Unexpected error occurred."> <description><![CDATA['.', hexadecimal value 0x00, is an invalid character. Line 2, position 1.]]></description> </event> </events> </unattendedInstallationResult>

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,808 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,289 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,563 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,634 questions
{count} votes

Accepted answer
  1. Rich Matheisen 47,056 Reputation points
    2024-11-08T19:43:12.8333333+00:00

    I see you asked the same question in StackOverflow (https://stackoverflow.com/questions/79166949/hexadecimal-value-0x00-is-an-invalid-character-line-2-position-1) and the replies there also find nothing wrong with the XML file content. If you're going to cross-post your questions, it's a good idea to provide a link to it.

    Based on all the answers/comments you've received, I took a closer look at your XML file.

    The XML prolog in the file, <?xml version="1.0" encoding="utf-8"?> implies that the data are encoded as UTF-8, but the file itself is encoded as UTF-16 (LE). UTF-8 encoded date would not have those interspersed 0x00 ($null) characters.

    Before changing the file encoded, try changing the XML prolog to <?xml version="1.0" encoding="UTF-16LE"?>.

    FYI, the "Veeam.Silent.Install.exe" is an executable file, not a PowerShell script. PowerShell is acting only as shell in much the same way as cmd.exe.


2 additional answers

Sort by: Most helpful
  1. Rich Matheisen 47,056 Reputation points
    2024-11-07T19:48:49.49+00:00

    I don't find anything wrong with the file contents.

    The file was encoded as UTF-16 (Little-Endian). You can open the file in a hex editor and see the first two bytes of the file are "0xFF 0xFE".

    The contents of the file appear to hold only ASCII characters (in the range of 0x00 - 0xFF, or 0 - 254). That means the file, when read, will have 0x00 appear to be interspersed between the actual characters. E.g., 0x3c and 0x3F (the "<" and "?") at the beginning of your file will appear as 0x3C, 0x00, 0x3F, 0x00.

    If the program reading the file ignores the first two bytes of the file (i.e., the "byte mark") and reads the contents as if they were just ASCII, then there's going to be problems.

    Can you post the way the program is reading the file?

    You can try opening the file in Notepad and then save the file (to another file name) as ASCII.

    Or, if the reading program is PowerShell and you're using Get-Content to acquire the data, add "-Encoding Unicode" as a parameter and value. PowerShell may be reading the file as if it was UTF-8 encoded.


  2. Jimmy Afflick 100 Reputation points
    2024-11-08T17:05:05.2433333+00:00

    @Rich Matheisen

    Hi Rich,

    Sorry for bothering you.

    Could you please let me know how to add add "-Encoding Unicode" as a parameter in my code.

    I am looking forward to hearing from you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.