Back to Blog|Tally Troubleshooting

Fix Tally XML Import Errors: Decode tally.imp Logs (2026 Guide)

May 23, 202612 Min ReadCA Rakesh Sharma

Importing high-volume accounting transactions from spreadsheets and custom database applications into Tally via XML is the gold standard for financial automation. In enterprise environments where thousands of sales invoices, purchase records, or bank statements are generated daily, manual data entry is simply not viable.

However, anyone who has attempted to programmatically build or import custom Tally XML files has likely encountered import failures. Unlike modern cloud applications that display real-time interactive error messages on the screen, TallyPrime historically fails silently. Instead of a popup, it dumps diagnostic logs into a flat text file called tally.imp.

Interpreting these cryptic log records requires deep knowledge of Tally's internal database constraints, structural XML tags, and double-entry accounting validations. In this guide, we will break down the file structure of tally.imp, analyze the most common XML schema validation issues, and provide step-by-step solutions to ensure error-free data imports.


1. Locating and Reading the Tally Import Log (`tally.imp`)

When you execute an import command in TallyPrime under **Import > Transactions** (or **Masters**), the software processes the XML packet sequentially. If any validation constraint fails, Tally skips that specific voucher, increments the error count, and writes the reason to tally.imp.

Where is the log file located?

The tally.imp file is always generated in the application folder where the active tally.exe is running. Depending on your operating system configuration, the typical paths include:

  • TallyPrime Default Path: C:\Program Files\TallyPrime\tally.imp
  • Tally.ERP 9 Legacy Path: C:\Tally.ERP9\tally.imp
  • Multi-user Server Path: If you are using TallyPrime Server, check the shared network path where the server gateway is hosted.

Because tally.imp is a cumulative log file, it appends new import results to the bottom. To review your latest run, open the file using a text editor like **Notepad** or **VS Code**, and scroll directly to the end of the file. Look for the timestamp matching your latest import attempt.

2. The Anatomy of a Valid Tally XML Voucher

Before debugging errors, it is vital to understand the structural XML tags that Tally expects. A typical double-entry voucher requires specific tags for parent containers, dates, voucher types, and ledger entries. Here is a structural template for a standard purchase voucher:

<ENVELOPE>
  <HEADER>
    <TALLYREQUEST>Import Data</TALLYREQUEST>
  </HEADER>
  <BODY>
    <IMPORTDATA>
      <REQUESTDESC>
        <REPORTNAME>Vouchers</REPORTNAME>
        <STATICVARIABLES>
          <SVCURRENTCOMPANY>TrulyInvoice Demo Pvt Ltd</SVCURRENTCOMPANY>
        </STATICVARIABLES>
      </REQUESTDESC>
      <REQUESTDATA>
        <TALLYMESSAGE xmlns:UDF="TallyUDF">
          <VOUCHER VCHTYPE="Purchase" ACTION="Create" OBJVIEW="Accounting Voucher View">
            <DATE>20260415</DATE>
            <VOUCHERTYPENAME>Purchase</VOUCHERTYPENAME>
            <VOUCHERNUMBER>TI/2026/04/089</VOUCHERNUMBER>
            <REFERENCE>TI/2026/04/089</REFERENCE>
            <PARTYLEDGERNAME>ACME Industrial Supplies</PARTYLEDGERNAME>
            <FBODY/>
            <!-- Debit Ledger Entry (Purchase Account) -->
            <ALLLEDGERENTRIES.LIST>
              <LEDGERNAME>Purchase Goods 18%</LEDGERNAME>
              <ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
              <AMOUNT>-10000.00</AMOUNT> <!-- Debit is represented as negative in Tally XML -->
            </ALLLEDGERENTRIES.LIST>
            <!-- Debit Ledger Entry (Input Tax IGST 18%) -->
            <ALLLEDGERENTRIES.LIST>
              <LEDGERNAME>Input IGST 18%</LEDGERNAME>
              <ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
              <AMOUNT>-1800.00</AMOUNT>
            </ALLLEDGERENTRIES.LIST>
            <!-- Credit Ledger Entry (Supplier Account) -->
            <ALLLEDGERENTRIES.LIST>
              <LEDGERNAME>ACME Industrial Supplies</LEDGERNAME>
              <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
              <AMOUNT>11800.00</AMOUNT> <!-- Credit is represented as positive in Tally XML -->
            </ALLLEDGERENTRIES.LIST>
          </VOUCHER>
        </TALLYMESSAGE>
      </REQUESTDATA>
    </IMPORTDATA>
  </BODY>
</ENVELOPE>

Key Tally XML Conventions:

  • Date Formatting: The <DATE> tag must always follow the YYYYMMDD format. Any deviations (like DD-MM-YYYY) will trigger parsing failures.
  • Sign Conventions: Counterintuitively, Tally represents **Debits** as negative numbers (e.g., -10000.00 with <ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>) and **Credits** as positive numbers (e.g., 11800.00 with <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>). Mismatching these will result in unbalanced voucher exceptions.

3. Tally XML Import Errors & Actionable Solutions

The table below categorizes the most frequent raw error strings found in the tally.imp log file, explains the root database cause, and details the exact programmatic or accounting fix required:

Raw Log Error StringRoot Database MismatchHow to Resolve (Exact Steps)
Referenced master '[Ledger Name]' does not exist.The XML voucher contains a <LEDGERNAME> tag specifying a ledger that is absent in the target Tally company database. Tally will reject the voucher to prevent database corruption.
  1. Verify spelling (Tally matches ledger names exact case-insensitively, but spaces and special characters must match).
  2. Check if the ledger is grouped under **Sundry Creditors**, **Sundry Debtors**, or **Duties & Taxes** (e.g. CGST, SGST, IGST).
  3. Create the missing ledger in Tally via **Gateway of Tally > Create > Ledger**, or import the Masters XML first.
Date [date] is out of range.The transaction date defined in <DATE> is outside the active financial year configuration or occurs before the **Books beginning from** date.
  1. Press Alt + F2 in Tally to ensure the active period covers the voucher date.
  2. Verify the company master configuration via **Gateway of Tally > Alt + K (Company) > Alter**. Check the **Books beginning from** date.
  3. Ensure the date tag format in your XML strictly follows YYYYMMDD.
Voucher Type '[Name]' does not exist.The voucher uses a custom <VOUCHERTYPENAME> (like "GST Purchase" or "Import Purchase") that has not been configured in the company masters.
  1. Go to **Gateway of Tally > Create > Voucher Type**.
  2. Create a new type matching the exact name from the log, setting the parent type (e.g., grouped under **Purchase**).
  3. Alternatively, map the XML tag back to the default Tally types like Purchase or Sales.
Total Debit and Credit amounts do not match.The sum of all debit allocations in the XML doesn't match the sum of credit allocations. Tally requires a net total of zero to preserve accounting integrity.
  1. Audit the math: Aggregate Debits = Aggregate Credits.
  2. Check rounding adjustments. If a purchase invoice is ₹1000.56, make sure a rounding ledger is included in the XML for the fractional paise.
  3. Check the negative/positive signs of the <AMOUNT> tags.
Can't mix Stock Items and Accounting Entries.The XML is formatted as an inventory invoice (Item Invoice) but contains tags configured only for accounting-only vouchers (Accounting Invoice view).
  1. Change the voucher configuration: set <VOUCHER VCHTYPE="Purchase" OBJVIEW="Invoice Voucher View">.
  2. Ensure item details are nested inside <ALLINVENTORYENTRIES.LIST> tags, referencing valid <STOCKITEMNAME> masters.

4. Understanding XML Schema and Tag Mismatches

Tally expects the XML to be structured in a hierarchical tree. A single missing tag closure or incorrect namespace can cause the parser to fail entirely before writing detailed errors to tally.imp.

Common syntax errors include:

  • Missing Namespace Attributes: The tag <TALLYMESSAGE xmlns:UDF="TallyUDF"> is required to handle User Defined Fields (UDFs). Omitting this attribute will throw XML parser errors on systems running customized Tally configurations.
  • Incorrect Tag Hierarchy: Ensure that <ALLLEDGERENTRIES.LIST> is nested inside the parent <VOUCHER> container. Placing ledger lists outside the voucher block will result in unmapped account errors.
  • Special Characters: Text values inside XML tags (like ledger names or voucher numbers containing & or <) must be HTML-escaped. For example, A & B Enterprises must be written as A &amp; B Enterprises. Failure to escape these will crash the Tally XML-RPC parser.

5. Visual Troubleshooting within TallyPrime

For users running TallyPrime, you do not always need to parse raw log files. The application offers a dedicated interface for exception tracking:

  1. Navigate to the **Gateway of Tally**.
  2. Select **Import > Exceptions** from the top menu.
  3. TallyPrime displays an interactive exception dashboard categorized into:
    • Master-related exceptions: Showing missing ledgers or duplicate stock names.
    • Voucher-related exceptions: Depicting date conflicts or unbalanced amounts.
  4. Drill down into any error line, press Enter, and you can directly correct ledger linkages or dates using Tally's UI, which then posts the pending voucher instantly.

6. Eliminating Import Errors with TrulyInvoice

Manually writing XML scripts or configuring fragile Excel macros is highly prone to human error and formatting discrepancies. TrulyInvoice provides a robust, zero-code solution designed specifically for clean Tally integrations.

Why TrulyInvoice is the Preferred Choice:

  • Auto-Ledger Mapping: Machine learning memorizes which scanned vendor matches your local Tally ledger spelling, avoiding "ledger does not exist" errors.
  • Pre-Import Math Validation: Compares and balances CGST, SGST, IGST (5%, 12%, 18%, 28%) and rounding ledger fractions before transmitting the XML.
  • Automated Date Parsing: Converts diverse invoice formats (e.g. 15-April-26, 15/04/2026) to standard YYYYMMDD automatically.
  • Flat Pricing Model: Get 2,000 pages per month (and bank statements unlimited) for a flat rate of plans starting at ₹399/month. Save hours of manual validation and troubleshooting.

Save your accounting and developer resources. Stop parsing log files manually and start automating with TrulyInvoice.

C
CA Rakesh SharmaExpert Reviewer

Chartered Accountant & Accounting Automation Specialist

Last Verified: May 23, 2026
TallyPrime FY 2026-27 (v4.0+)
Ready to save time?

Stop Manual Voucher Entry.

TrulyInvoice automates your complete invoice workflow and syncs directly to Tally Prime.

No credit card · 14-day free trial

01

Upload Invoice

Drag & drop PDFs, scans, or photos.

02

AI Extraction

Line items, tax, and ledgers mapped.

03

1-Click Review

Verify extracted details on dashboard.

04

Direct Sync

Vouchers created instantly in Tally Prime.

Chat with us