Unknown metadata tag

16 views
Skip to first unread message

melb...@gmail.com

unread,
Mar 14, 2022, 6:21:27 PMMar 14
to Ledger
Hello,
I am trying to run an old ledger file where I have lots of metadata tags (key/value pairs) and I am getting theses errors. 

 % ledger -f test.ledger bal
Warning: "test.ledger", line 7: Unknown metadata tag 'MyTag'
                -100  Cash
                 100  Expenses
--------------------
                   0


Here's the test file:

account Cash
account Expenses

2022-01-01
    Expenses   100
    Cash
      ; MyTag: foo


What is the issue?

melb...@gmail.com

unread,
Mar 14, 2022, 6:38:59 PMMar 14
to Ledger

Martin Michlmayr

unread,
Mar 14, 2022, 8:36:59 PMMar 14
to ledge...@googlegroups.com
* melb...@gmail.com <melb...@gmail.com> [2022-03-14 15:21]:
> I am trying to run an old ledger file where I have lots of metadata tags
> (key/value pairs) and I am getting theses errors.
>
> % ledger -f test.ledger bal
> Warning: "test.ledger", line 7: Unknown metadata tag 'MyTag'

You probably have --strict in your ~/.ledgerrc.

The manual says:
If using the --strict or --pedantic options, you must declare this tag to avoid warnings and errors.

(This wasn't fully checked in the past due to bugs; they have been
fixed, which is why you see this now and not before.)

> Here's the test file:
>
> account Cash
> account Expenses

You miss the tag declaration here:

tag MyTag

--
Martin Michlmayr
https://www.cyrius.com/

melb...@gmail.com

unread,
Mar 14, 2022, 8:50:12 PMMar 14
to Ledger
Thank you sir! I had --strict in my .ledgerrc, which I created in 2019. I totally forgot about the rc file..
Reply all
Reply to author
Forward
0 new messages