ledger xact - "Error: Invalid date:"

314 views
Skip to first unread message

Leo Bossmann

unread,
Sep 11, 2017, 2:32:50 PM9/11/17
to Ledger
Hi all,

I still have the problem I described in an earlier post, but it is not a ledger-mode problem.  The short version is that "ledger xact" is not working anymore (it was fine in ledger 3.1.1_2, in 3.1.1_6/7 it seems to be broken).  I am running macOS Sierra 10.12.6 and I have installed ledger with homebrew.

I narrowed it down to something in ledger itself, can someone perhaps confirm my findings? If my conclusions are wrong there is probably a problem with my environment :/

This is my input file (test.ledger):
2017/09/01 Google
    asdf                                      123,00 EUR
    bsdf

2017/09/01 Facebook
    asdf                                      234,00 EUR
    bsdf


When I try
ledger -f test.ledger xact 2017/09/03 Google
I get "Error: Invalid date:"

When running it without a date, e.g.
ledger -f test.ledger xact Google

it returns, as expected
2017/09/11 Google
    asdf                                  123,00 EUR
    bsdf

There is no .ledgerrc that could mess up settings.

Is it only broken on my machine, or is it broken for somebody else too?

Thanks in advance,

Leo
test.ledger
Message has been deleted

Leo Bossmann

unread,
Oct 9, 2017, 11:35:15 AM10/9/17
to Ledger
Hi all,

in the meantime I have reinstalled my Mac with Macos High Sierra 10.13 (fresh install, not an upgrade). I have reinstalled homebrew and ledger and the problem persists. I believe it has to to with the Mac platform, the same version (Ledger 3.1.1-20160111) installed on Ubuntu works as expected. Or can it be a library that has been updated?

Can anybody confirm this behavior, or point me into the right direction?

I also checked the source where the error is thrown (src/times.cc):
throw_(date_error, _f("Invalid date: %1%") % date_str);

which, if I am not mistaken, means that it should also output the invalid date string, right? But it does not do that, which could mean that it somehow tries to parses the wrong parameter (or an empty string) as date.

I am really out of things to try, any help is appreciated.

BTW, bugs.ledger-cli.org seems to be down.

Kind regards,

Leo

Alexander Pletnev

unread,
Oct 13, 2017, 2:48:50 AM10/13/17
to Ledger
Having the same problem after update ledger on mac. Please post if you solved. 

Craig Earls

unread,
Oct 13, 2017, 6:07:45 AM10/13/17
to ledge...@googlegroups.com
I just moved to High Sierra, no problem here I use the hombrew install as well. I do build from source though. 

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Craig, Corona De Tucson, AZ
missile_flyout
enderw88.wordpress.com

John Wiegley

unread,
Oct 13, 2017, 5:32:34 PM10/13/17
to Leo Bossmann, Ledger
>>>>> "LB" == Leo Bossmann <leo.bo...@gmail.com> writes:

LB> ledger -f test.ledger xact 2017/09/03 Google
LB> I get* "Error: Invalid date:"*

Hmmm... I wonder if something changed in the C++ library, since we're using
that for doing date parsing.

John

Alexandre Rademaker

unread,
Oct 24, 2017, 6:33:30 PM10/24/17
to Ledger

Same error here! Any Idea? I am running High Sierra with Ledger installed via `brew install ledger`.

Best,

Craig Earls

unread,
Oct 24, 2017, 6:40:22 PM10/24/17
to ledge...@googlegroups.com
I have the same installation description with no problem.  Try brew install -s ledger to build it from source. Possibly there is binary compatibility issue with the brewed installation 

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexandre Rademaker

unread,
Oct 24, 2017, 7:07:21 PM10/24/17
to ledge...@googlegroups.com
Hum... This is strange! 

After

$ brew uninstall ledger
$ brew install -s ledger

same error:

$ ledger -f 2017.dat xact 2017/10/24 Chacaltaya R$10
Error: Invalid date:


$ ledger
Ledger 3.1.1-20160111, the command-line accounting tool

Copyright (c) 2003-2016, John Wiegley.  All rights reserved.

This program is made available under the terms of the BSD Public License.
See LICENSE file included with the distribution for details and disclaimer.
Error: No journal file was specified (please use -f)

$ uname -a
Darwin urca.local 17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64

Cheers,


<image001.gif>

Craig Earls

unread,
Oct 24, 2017, 7:09:10 PM10/24/17
to ledge...@googlegroups.com
Are you escaping the dollar sign properly for your shell?

Alexandre Rademaker

unread,
Oct 24, 2017, 7:15:54 PM10/24/17
to ledge...@googlegroups.com
Hi Craig,

I think so

$ ledger -f 2017.dat xact 2017/10/24 Chacaltaya R\$10
Error: Invalid date:

The same error inside Emacs with `C-c C-a`. No idea here... any help will be welcome! ;-)

Best,

John Wiegley

unread,
Oct 24, 2017, 8:11:00 PM10/24/17
to Alexandre Rademaker, ledge...@googlegroups.com
>>>>> "AR" == Alexandre Rademaker <arade...@gmail.com> writes:

AR> $ ledger -f 2017.dat xact 2017/10/24 Chacaltaya R\$10
AR> Error: Invalid date:

This has been reported before. I wonder if it's something with the C++
libraries on High Sierra.

John

Alexandre Rademaker

unread,
Oct 24, 2017, 8:12:38 PM10/24/17
to ledge...@googlegroups.com

I am trying to install via MacPorts, but I am scared with the number of dependencies....

Craig Earls

unread,
Oct 24, 2017, 8:22:44 PM10/24/17
to ledge...@googlegroups.com, Alexandre Rademaker



17:16:44 ~/FinanceData > ledger xact 2017-10-31 Dep

2017-10-31 Deposit

    Assets:VWCU:Grace                        $ 12.00

    Expenses:Medical:Professional Fees

17:16:51 ~/FinanceData > ledger xact 2017/10/31 Dep  RMB45

2017-10-31 Deposit

    Assets:VWCU:Grace                          RMB45

    Expenses:Medical:Professional Fees

17:16:56 ~/FinanceData > ledger xact 2017/10/31 Dep  R\$45

2017-10-31 Deposit

    Assets:VWCU:Grace                           R$45

    Expenses:Medical:Professional Fees

17:19:59 ~/FinanceData > ledger --version

Ledger 3.1.1-20160111, the command-line accounting tool


Copyright (c) 2003-2016, John Wiegley.  All rights reserved.


This program is made available under the terms of the BSD Public License.

See LICENSE file included with the distribution for details and disclaimer.

17:20:03 ~/FinanceData > 



17:20:03 ~/FinanceData > brew info boost

boost: stable 1.65.1 (bottled), HEAD

Collection of portable C++ source libraries

https://www.boost.org/

/usr/local/Cellar/boost/1.65.1 (12,679 files, 404.2MB) *

  Built from source on 2017-09-08 at 21:31:17

From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/boost.rb

==> Dependencies

Optional: icu4c

==> Options

--c++11

Build using C++11 mode

--with-icu4c

Build regexp engine with icu support

--without-single

Disable building single-threading variant

--without-static

Disable building static library variant

--HEAD

Install HEAD version

17:22:13 ~/FinanceData > brew info ledger

ledger: stable 3.1.1 (bottled), HEAD

Command-line, double-entry accounting tool

http://ledger-cli.org

/usr/local/Cellar/ledger/3.1.1_7 (153 files, 14.7MB) *

  Built from source on 2017-09-08 at 22:01:48

From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ledger.rb

==> Dependencies

Build: cmake

Required: gmp , mpfr , boost , boost-python

==> Options

--with-debug

Build with debugging symbols enabled

--with-docs

Build HTML documentation

--without-python

Build without python support

--HEAD

Install HEAD version

==> Caveats

Emacs Lisp files have been installed to:

  /usr/local/share/emacs/site-lisp/ledger

17:22:22 ~/FinanceData > 



--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Alexandre Rademaker

unread,
Nov 2, 2017, 3:56:02 PM11/2/17
to Ledger

Does any one have a solution for this problem??

BTW, today I got a new error

Error: Incorrect use of thousand-mark period
While parsing file "/Users/arademaker/Documents/Financeiro/data/2017.dat", line 7275:
While parsing posting:
  Expenses:Educacao:Curso:Sofia             R$ 432.63
                                            ^^^^^^^^^


Any idea?


Alexandre Rademaker

unread,
Nov 2, 2017, 4:21:30 PM11/2/17
to ledge...@googlegroups.com

Only to make it precise, the message was

 
While parsing file "/Users/arademaker/Documents/Financeiro/data/2017.dat", line 7275:
While parsing posting:
  Expenses:Educacao:Curso:Sofia             R$ 432.63
                                            ^^^^^^^^^
Error: Incorrect use of thousand-mark period

Alexandre

John Rakestraw

unread,
Aug 19, 2019, 3:15:53 PM8/19/19
to ledge...@googlegroups.com
Apologies for resurrecting this old thread. But I'm wondering if anyone has identified a solution to this date parsing issue.

I tried Craig's suggestion above -- upgraded ledger (building from source with "brew install -s ledger). An attempt to add a transaction using "ledger-add-transaction" fails with the error message "Error: Invalid date:" I get the same error running ledger in the terminal and running ledger-mode.

In ledger-mode, I don't get the error if I merely specify the date in the minibuffer (either the default "2018/08/" or adding the day of the month) without supplying any other information about a transaction. Doing that inserts the appropriate date at the appropriate place in my ledger file with the cursor placed for me to add the description.

Info: MacOS 10.13.6; Ledger 3.1.3-20190331.

Any ideas?

--John

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages