Opened 2 years ago
Last modified 18 months ago
#323 new defect
pycsw - inconsistent path requirements for admin vs. front end
|Reported by:||TC Haddad||Owned by:||Jeff McKenna|
|Component:||MS4W - Packages||Version:||4.0.5|
This is probably not only an MS4W issue, but it is probably specific to Windows users of pycsw, so noting it here with examples from the MS4W demo:
The main admin tool for pycsw is 'pycsw-admin.py' as documented here:
It appears that this script is requiring a full drive path in the configuration settings, for access to the pycsw database:
Without a full path, the script will throw an error complaining about not being able to find the database.
[...] sqlite3.OperationalError: unable to open database file [...] sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
Meanwhile, the main pycsw application is accessed via the browser at:
For this to work, the it seems the path to the database should not have the drive letter configured as in
Without this version of the path, the main pycsw application will return an error of:
<!-- pycsw 2.6.0 --> <ows20:ExceptionReport version="3.0.0" xml:lang="en-US" xsi:schemaLocation="http://www.opengis.net/ows/2.0 http://schemas.opengis.net/ows/2.0/owsExceptionReport.xsd"> <ows20:Exception exceptionCode="NoApplicableCode" locator="service"> <ows20:ExceptionText>Could not initialize repository. Check server logs</ows20:ExceptionText> </ows20:Exception> </ows20:ExceptionReport>
It would be convenient if both the pycsw admin and the pycsw front-end could operate using the same path configuration to the database, as it is inconvenient to switch between the two (although no restart is required, so it's not as bad as it could be).
I found an old unresolved stack exchange question that seemed like it could be related, so I think this is Windows specific rather than MS4W specific:
Not sure if you would try to handle it for MS4W, or pass to the pycsw folks?
Change History (3)
comment:1 by , 2 years ago
comment:2 by , 2 years ago
Thanks for the tip, you are correct I wasn't in that directory. Here's what I was doing:
python C:\ms4w\apps\pycsw-2.6.0\bin\pycsw-admin.py -c load_records -f C:\ms4w\apps\pycsw-2.6.0\default.cfg -p C:\metadata\noaa\nos\test
To be honest, I thought doing this way meant that it didn't matter which directory I was running from because the script would run from the path specified, and everything the script needs would be relative from the various locations specified. But I stand corrected! Apologies for the false alarm...
comment:3 by , 18 months ago
|Milestone:||4.1.0 release → 5.0.0 release|
(sorry for my delay in responding, I wanted to give some good testing before responding)
I cannot replicate the error mentioned above. The relative path works for me through both the commandline and Apache:
Can you let me know what exact command you are trying, and which directory you are in when you issue the command?
For example, since the 'database' path in default.cfg is relative to the C:/ms4w/pycsw-2.6.0/ directory, all subsequent commandline requests should be done while inside that same directory, such as:
or to load records into that new SQLite file, cd into C:/ms4w/pycsw-2.6.0/ and then:
Maybe this needs stating in the README, if yes please let me know. Thanks for this testing feedback!!