GNOME Bugzilla – Bug 657117
Finance::Quote not installed properly
Last modified: 2018-06-29 23:00:27 UTC
I am using Strawberry perl (perl 5, version 12, subversion 2 (v5.12.2) built for MSWin32-x86-multi-thread) and have used the scripts as supplied to test the installed modules for FInance::Quote. All scripts work as expected (gnc-fq-check, gnc-fq-dump, gnc-fq-helper, gnc-fq-update)without throwing errors. Running install-fq-mods.cmd with admin account works OK and reports succesful install. When I run gnucash the security editor still reports Warning: Finance::Quote not installed properly. Any suggestions ? (apart from Active perl which I am avoiding on this machine for other reasons) Thanks.
Is there anything in the gnucash trace file [1] ? [1] http://wiki.gnucash.org/wiki/Windows#Error_messages.2C_Trace_file
I checked the trace file on starting gnucash. * 19:15:53 WARN <qof.engine> [guid_init()] only got 2246 bytes. The identifiers might not be very random. * 19:16:46 WARN <gnc.app-utils> Could not spawn perl: Failed to execute child process (Invalid argument) I presume gnc.app-utils has an activestate perl path coded, rather than the Strawberry perl I have. If this sounds a sensible suggestion any idea where I can change the relevent paths ?
To get a better idea what is going on, I installed Strawberry perl on my test box (version 5.12.3). But contrary to your report, install-fq-mods.cmd doesn't run successfully. It installs all the missing modules, but I can't get it to pass perl -w gnc-fq-check successfully. It continues to complain that Finance::Quote should be installed. Manually running perl -w gnc-fq-update runs through another set if installs and in the end reports that all modules are installed. Yet, gnc-fq-check still fails due to a (seemingly) missing Finance::Quote. In order to continue to evaluate this, can you tell me how you managed to run these commands successfully ?
Hello Geert. I upgraded to Strawberry perl 5.12.3 as well, so we are consistent. After running install-fq-mods.cmd I had a similar error. I used the cpan shell to install Finance::Quote, which also installed HTML::TableExtract as a pre-requisite for Finance::Quote cpan> install ECOCODE/Finance-Quote-1.17.tar.gz After these installs install-fq-mods.cmd runs without error I then ran perl gnc-fq-update. This identified the following version issues, and fixed nearly all.... Warning: prerequisite Encode::Locale 0 not found. Warning: prerequisite File::Listing 6 not found. We have 5.837. Warning: prerequisite HTTP::Cookies 6 not found. We have 5.837. Warning: prerequisite HTTP::Daemon 6 not found. We have 5.827. Warning: prerequisite HTTP::Date 6 not found. We have 5.831. Warning: prerequisite HTTP::Negotiate 6 not found. We have 5.835. Warning: prerequisite HTTP::Request 6 not found. We have 5.827. Warning: prerequisite HTTP::Request::Common 6 not found. We have 5.824. Warning: prerequisite HTTP::Response 6 not found. We have 5.836. Warning: prerequisite HTTP::Status 6 not found. We have 5.817. Warning: prerequisite LWP::MediaTypes 6 not found. We have 5.835. Warning: prerequisite Net::HTTP 6 not found. We have 5.834. Warning: prerequisite WWW::RobotRules 6 not found. We have 5.832. It did not install HTML::Parser - having one test fail. I resorted to cpan shell and installed this (no error shown under cpan shell) cpan> install GAAS/HTML-Parser-3.69.tar.gz After this gnc-fq-update runs with no issues. I then used gnc-fq-dump to prove matters pulling stock quote from nyse exchange... C:\Program Files\gnucash\bin>perl gnc-fq-dump nyse CMI Finance::Quote fields Gnucash uses: symbol: CMI <=== required date: 02/13/2012 <=== required currency: USD <=== required last: 122.88 <=\ nav: <=== one of these price: 122.88 <=/ timezone: <=== optional All seems to be OK. I then started gnucash (now version 2.4.9) The security editor shows the error "Warning: Finance::Quote not installed properly" The trace file entry says.... WARN <gnc.app-utils> Could not spawn perl: Failed to execute child process (Invalid argument) grep'ing the bin directory seems this message comes from libgncmod-app-utils.dll Could it be that perl is called with absolute path, and expecting the binary to be c:\perl\bin\perl.exe or something ?
PS. I am happy to try figure out what changes are necessary to get a cleaner install from Strawberry perl (in gnc-fq-update install-fq-mods.cmd) if we can resolve this part of the puzzle. Rgds Dave
Thanks for the walkthrough. I only had to install Finance::Quote via CPAN. There was no need to run gnc-fq-update. Or perhaps I didn't have to because I had already run it before. The strange thing is, that with this change I can use the Get Quotes button in GnuCash. It doesn't work successfully fetch (currency) quotes, but that is equally so on my linux installation. So I suspect this is rather due to something Yahoo changed (again) in their web interface. Perl is called from the file price-quotes.scm. I have checked, but it doesn't use an absolute path, it's just "perl". So I wonder why it doesn't work for you. In what path have you installed Strawberry ?
My perl is installed C:\strawberry\perl\bin> which I believe is default for this perl flavour. I checked all C:/ drive. only one perl.exe. My path is Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\CyberLink\Power2GoC:\Program Files\PHP\;C:\Program Files\gnuwin32;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\Program Files\Vim\vim72;C:\Program Files\gnuwin32\bin;C:\Program Files\QuickTime\QTSystem\ perl.exe is on the path. I checked price-quotes.scm, and can see the perl calls here. I suspect there is an earlier check, as I get the error message "Warning: Finance::Quote not installed properly", and don't see where is is generated from. Suspect that is what disables the ability to make other calls.
(In reply to comment #7) > My perl is installed C:\strawberry\perl\bin> > which I believe is default for this perl flavour. > Indeed, that's where I have installed it as well. > I checked all C:/ drive. only one perl.exe. My path is > > Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program > Files\CyberLink\Power2GoC:\Program Files\PHP\;C:\Program > Files\gnuwin32;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\Program > Files\Vim\vim72;C:\Program Files\gnuwin32\bin;C:\Program > Files\QuickTime\QTSystem\ > > perl.exe is on the path. > Indeed. > I checked price-quotes.scm, and can see the perl calls here. I suspect there is > an earlier check, as I get the error message "Warning: Finance::Quote not > installed properly", and don't see where is is generated from. Suspect that is > what disables the ability to make other calls. The "Warning: Finance::Quote" is just a label on the Price editor dialog. It is shown on hidden depending on a test run early on that eventually calls gnc:fq-check-sources (found in price-quotes.scm, line 245). gnc:fq-check-sources tries to execute the perl script gnc-fq-check. If that perl call fails for some reason, GnuCash assumes something is wrong with the Finance::Quote installation and will display the Warning label you see. The real hint to what is wrong can be found in your trace file (see comment 2): * 19:16:46 WARN <gnc.app-utils> Could not spawn perl: Failed to execute child process (Invalid argument) Still a vague message but for some reason perl has issues with the arguments passed to it. Where is your GnuCash installed ?
My Gnucash is installed C:\Program Files\gnucash I have had previous installs in other locations, but uninstalled all before installing this version. the command "perl -w gnc-fq-check" runs fine, returning a large number of source for Finance::Quote Because there have been previous gnucash installs on this machine is it possible some path information still exists ? The previous install locations no longer exist (deleted). Could there be something in the home directory files ? I have modified price-quotes.scm and provided full path to perl in this. ie (list "c:/strawberry/perl/bin/perl.exe " "-w" gnc:*finance-quote-helper*) #t)))) This works - and I can get stock quotes via gnucash.... Suggest the issue may be on of the path used in the call. Any idea how I can figure this out (it would mean gnucash is not using the system Path) Thanks
Created attachment 207646 [details] Modified price-quotes.scm with some additional debug information. This is very weird. When entered on the command prompt "perl -w gnc-fq-check" runs fine, but from within GnuCash it requires a full path... I have attached a slightly modified price-quotes.scm file that outputs a little more debug information. Can you replace the one in your gnucash installation with this one ? To see the debug information you will have to start gnucash from the command line as follows: gnucash --log "gnc.scm=debug" (From within the directory where gnucash is installed) Then look into the trace file that is generated, it should now have a line showing the actual path as seen by gnucash and additionally the full path the gnc-fq-check. Can you post these two ?
Created attachment 207659 [details] trace file from modified price-quote.scm
I have installed the modified price-quotes.scm you provided, and run the trace file (trace file attached). This is really wierd - the path information looks fine, but perl call fails. I'll add the price-quotes.scm file with path information that works....
Created attachment 207661 [details] price-quotes.scm file with hard coded path for perl, that works.....
This really looks like there is another perl somewhere in your path. Can you use the windows search functions to search for "perl" starting from the C drive and check if any of the results comes from a directory that is in the path before the strawberry perl lines ? I suppose a "perl executable" can take the form "perl.exe" or "perl.cmd". Another thing you could try is to modify your path and move the strawberry related pieces to the beginning of the path. And then check if it will work.
Fixed: Working on your suggestion I decided to search just the directoies in the PATH variable.. This is what the perl script I worte to do that turned up.... Dir: C:\Windows\system32 Dir: C:\Windows Dir: C:\Windows\System32\Wbem Invalid Dir: C:\Program Files\CyberLink\Power2GoC:\Program Files\PHP\ Dir: C:\Program Files\gnuwin32 Dir: C:\Windows\System32\WindowsPowerShell\v1.0\ Dir: C:\strawberry\c\bin Dir: C:\strawberry\perl\site\bin Dir: C:\strawberry\perl\bin cpanp-run-perl cpanp-run-perl.bat find2perl.bat perl.exe perl5.12.3.exe perl512.dll perlbug.bat perldoc.bat perlglob.bat perlglob.exe perlivp.bat perlthanks.bat runperl.bat wperl.exe Dir: C:\Program Files\Vim\vim72 Dir: C:\Program Files\gnuwin32\bin Dir: C:\Program Files\QuickTime\QTSystem\ Note the invalid directory. I corrected the system wide PATH by adding ; in the critical place, changed proce-quotes.scm for the original one and started gnucash. The Price Editor allows quotes to be obtained ! My conclusion is that the environment used when spawning the perl command from the scm program is used or set differently. From debug it looks like searching of the PATH is halted if an invalid directory ios found, clearly a different behaviour from that found using a command window. So that is my machine fixed. Thanks for your support. Suggestions... 1) Can the install check the PATH variable (my script attached below can be modified) 2) Do you want changes for gnc-fq-update, install-fq-mods.cmd suggested so they provide a clean install for strawberry perl as well as ActiveState ? If so I can look at that .....
Created attachment 207695 [details] perl script perl script to check all directories in PATH for instances of files/directories with "perl" in their name. Also reports invalid directories
(In reply to comment #15) > Fixed: Wonderful ! > Note the invalid directory. I corrected the system wide PATH by adding ; in the > critical place, changed proce-quotes.scm for the original one and started > gnucash. The Price Editor allows quotes to be obtained ! > > My conclusion is that the environment used when spawning the perl command from > the scm program is used or set differently. From debug it looks like searching > of the PATH is halted if an invalid directory ios found, clearly a different > behaviour from that found using a command window. So that is my machine fixed. > Thanks for your support. I can indeed confirm this behaviour although the issue is slightly more subtle than your perl script tests. Your script tests for the existence of the directories on the path. But that is not really relevant. Non-existing directories are just fine. The issue looks to me that by omitting the semi-colon, a directory path is created with two colons in it. The error message is produced by g_spawn_async_with_pipes, a glib funtion. So I suspect that glib (or mingw ?) gets confused by weird paths and raises an error. Also if the invalid directory path comes after the strawberry paths in the PATH variable, it will work ok as well. It is really because the invalid path comes before the strawberry paths that there may be an error. > Suggestions... > 1) Can the install check the PATH variable (my script attached below can be > modified) > 2) Do you want changes for gnc-fq-update, install-fq-mods.cmd suggested so they > provide a clean install for strawberry perl as well as ActiveState ? If so I > can look at that ..... I think both suggestions are useful, and I would be particularly happy with the second one. Another nice addition in this area would be that install-fq-mods.cmd (after user confirmation) automatically installs perl if it's not installed already. Patches for any of these suggestions (including your slightly modified directory test script) are preferably attached to new enhancement requests though instead of this bugreport. I'm not sure what to do with this bugreport now. We found the cause of the problem, determined it's not GnuCash (but rather glib), we managed to correct your problem by fixing the path and I've reported the problem in glib. For me that would be sufficient to close this one. If you don't agree, feel free to reopen it.
Oh, I forgot to mention the glib bug I opened: bug 670233
(In reply to comment #18) > Oh, I forgot to mention the glib bug I opened: bug 670233 Gert - Thanks for your staying power and closure comments, I concur and will work to develop the enhancements... to be raised as you suggest. Regards Dave
Enhancement request to verify system path submitted.... see Bug 670339 - Enhancement Request: Avoid glib bug 670233
Enhancement request to install perl, if necessary, during install of Finance-Quote has been submitted - see https://bugzilla.gnome.org/show_bug.cgi?id=670355
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=657117. Please update any external references or bookmarks.