#1683: error message v.add.col on MacOSX
-------------------------+--------------------------------------------------
Reporter: jradinger | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Database | Version: svn-develbranch6
Keywords: v.add.col | Platform: MacOSX
Cpu: Unspecified |
-------------------------+--------------------------------------------------
When trying to add a new column (v.db.addcol map=basins@test columns=area
DOUBLE) following error message is produced. Anyway the column is created
and
there seems no problem with the database table. Just the error message:
/Applications/GRASS-6.5.app/Contents/MacOS/scripts/v.db.addc
ol: line 80: Radinger/Library/GRASS/6.5/Modules/bin=/Library
/GRASS/6.5/Modules/bin:/Users/Johannes:/Users/Johannes
Radinger/Documents/GRASS-GIS/Scripts: No such file or
directory
/Applications/GRASS-6.5.app/Contents/MacOS/scripts/v.db.addc
ol: line 80: Radinger/Documents/GRASS-
GIS/Scripts=/Users/Johannes Radinger/Desktop: No such file
or directory
#1683: error message v.add.col on MacOSX
-------------------------+--------------------------------------------------
Reporter: jradinger | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Database | Version: svn-develbranch6
Keywords: v.add.col | Platform: MacOSX
Cpu: Unspecified |
-------------------------+--------------------------------------------------
Description changed by neteler:
Old description:
When trying to add a new column (v.db.addcol map=basins@test columns=area
DOUBLE) following error message is produced. Anyway the column is created
and
there seems no problem with the database table. Just the error message:
/Applications/GRASS-6.5.app/Contents/MacOS/scripts/v.db.addc
ol: line 80: Radinger/Library/GRASS/6.5/Modules/bin=/Library
/GRASS/6.5/Modules/bin:/Users/Johannes:/Users/Johannes
Radinger/Documents/GRASS-GIS/Scripts: No such file or
directory
/Applications/GRASS-6.5.app/Contents/MacOS/scripts/v.db.addc
ol: line 80: Radinger/Documents/GRASS-
GIS/Scripts=/Users/Johannes Radinger/Desktop: No such file
or directory
New description:
When trying to add a new column (v.db.addcol map=basins@test columns=area
DOUBLE) following error message is produced. Anyway the column is created
and
there seems no problem with the database table. Just the error message:
{{{
/Applications/GRASS-6.5.app/Contents/MacOS/scripts/v.db.addc
ol: line 80: Radinger/Library/GRASS/6.5/Modules/bin=/Library
/GRASS/6.5/Modules/bin:/Users/Johannes:/Users/Johannes
Radinger/Documents/GRASS-GIS/Scripts: No such file or
directory
/Applications/GRASS-6.5.app/Contents/MacOS/scripts/v.db.addc
ol: line 80: Radinger/Documents/GRASS-
GIS/Scripts=/Users/Johannes Radinger/Desktop: No such file
or directory
}}}
For shell debugging, please change the first line of
/Applications/GRASS-6.5.app/Contents/MacOS/scripts/v.db.addcol
from
{{{
#!/bin/sh
}}}
to
{{{
#!/bin/sh -x
}}}
and run it again. Then post the relevant error part here, thanks.
#1683: error message v.add.col on MacOSX
-------------------------+--------------------------------------------------
Reporter: jradinger | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: Database | Version: svn-develbranch6
Keywords: v.add.col | Platform: All
Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):
* priority: normal => major
* platform: MacOSX => All
* milestone: 6.5.0 => 6.4.3
Comment:
The problem is the white space in the path not handled properly:
{{{
...
+ eval 'GISDBASE='\''/Users/Johannes' 'Radinger/Documents/GRASS-GIS'\'';'
'LOCATION_NAME='\''spearfish60'\'';' 'MAPSET='\''test'\'';'
'ADDON_PATH='\''/Users/Johannes'
Radinger/Library/GRASS/6.5/Modules/bin:/Library/GRASS/6.5/Modules/bin:/Users/Johannes
'Radinger/Library/GRASS/6.5/Modules/bin:/Library/GRASS/6.5/Modules/bin:/Users/Johannes'\'';'
'Radinger/Library/GRASS/6.5/Modules/bin='\''/Library/GRASS/6.5/Modules/bin:/Users/Johannes:/Users/Johannes'
'Radinger/Documents/GRASS-GIS/Scripts'\'';' 'Radinger/Documents/GRASS-
GIS/Scripts='\''/Users/Johannes' 'Radinger/Desktop'\'';'
'MONITOR='\''x7'\'';' 'GRASS_GUI='\''wxpython'\'';'
++ GISDBASE='/Users/Johannes Radinger/Documents/GRASS-GIS'
++ LOCATION_NAME=spearfish60
++ MAPSET=test
++ ADDON_PATH='/Users/Johannes
Radinger/Library/GRASS/6.5/Modules/bin:/Library/GRASS/6.5/Modules/bin:/Users/Johannes
Radinger/Library/GRASS/6.5/Modules/bin:/Library/GRASS/6.5/Modules/bin:/Users/Johannes'
++
'Radinger/Library/GRASS/6.5/Modules/bin=/Library/GRASS/6.5/Modules/bin:/Users/Johannes:/Users/Johannes
Radinger/Documents/GRASS-GIS/Scripts'
/Applications/GRASS-6.5.app/Contents/MacOS/scripts/v.db.addcol: line 80:
Radinger/Library/GRASS/6.5/Modules/bin=/Library/GRASS/6.5/Modules/bin:/Users/Johannes:/Users/Johannes
Radinger/Documents/GRASS-GIS/Scripts: No such file or directory
++ 'Radinger/Documents/GRASS-GIS/Scripts=/Users/Johannes Radinger/Desktop'
/Applications/GRASS-6.5.app/Contents/MacOS/scripts/v.db.addcol: line 80:
Radinger/Documents/GRASS-GIS/Scripts=/Users/Johannes Radinger/Desktop: No
such file or directory
++ MONITOR=x7
...
}}}
The underlying fix is to not store the addon path as a GRASS variable,
store it as a shell environment variable -- and only a shell variable --
instead.
Remove it from the g.gisenv list with:
{{{
g.gisenv set="ADDON_PATH="
}}}
then v.db.addcol should be happy.
Trying to make it both a shell environment variable and a grass variable
is well intentioned, but blurring definitions so that things can be set
and read independently in multiple places using the same namespace is
ultimately going to create more problems than it solves. The main question
I think is if we need some other place besides .grass.bashrc to store this
sort of thing, to be sourced by the grass startup script. ? (currently for
grass6 it needs to be set in ~/.bashrc since .grass.bashrc is sourced
later in the startup script.
The GUI can modify its own running environment on the fly with
os.environ(); command line users who want to modify their environment
generally can, and indeed want to, take care of themselves.
#1683: error message v.add.col on MacOSX
---------------------------+------------------------------------------------
Reporter: jradinger | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: Shell Scripts | Version: svn-develbranch6
Keywords: v.db.addcol | Platform: All
Cpu: Unspecified |
---------------------------+------------------------------------------------
Comment(by hamish):
n.b. the `eval g.gisenv` will still be problematic if the GISDBASE path
contains a space. In this case just the MAPSET name is needed, so `eval
g.gisenv MAPSET` avoids trouble, but quoting by g.gisenv is something we
should probably discuss.
(nonetheless, having GRASS_ADDON_PATH enviro var and ADDON_PATH grass var
is unfortunate)
#1683: error message v.add.col on MacOSX
---------------------------+------------------------------------------------
Reporter: jradinger | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: Shell Scripts | Version: svn-develbranch6
Keywords: v.db.addcol | Platform: All
Cpu: Unspecified |
---------------------------+------------------------------------------------
Comment(by neteler):
Replying to [comment:5 hamish]:
> The immediate culprit is `eval g.gisenv`,
>
> The underlying fix is to not store the addon path as a GRASS variable,
store it as a shell environment variable -- and only a shell variable --
instead.
>
> Remove it from the g.gisenv list with:
> {{{
> g.gisenv set="ADDON_PATH="
> }}}
> then v.db.addcol should be happy.
today I tried example again and found out that the error messages are
related
a messy gisenv. Here first the errors from v.db.addcol
{{{
v.db.addcol map="test@FIDIMO_Cele" columns="testcol DOUBLE"
/usr/local/grass-6.5.svn/scripts/v.db.addcol: 1: eval:
adinger/U_Radinger/05_GRASS/GR=/home/radinger/U_Radinger/05_GRASS/GRASS_Scripts:
not found
/usr/local/grass-6.5.svn/scripts/v.db.addcol: 1: eval:
adinger/05_GRASS/GRASS_Scripts=/home/radinger/U_Radinger/05_GRASS/FIDIMO/FIDIMO_Script/fidimo
for grass 6.x/r.fidimo: not found
/usr/local/grass-6.5.svn/scripts/v.db.addcol: 1: eval:
/r.rdfilter=/home/radinger/U_Radinger/05_GRASS/FIDIMO/FIDIMO_Script/fidimo
for grass 6.x/r.fidimo: not found
GRASS 6.5.svn (Cele_location):~ >
}}}
So I also checked the output of g.gisenv from the command line which seems
somehow
wrong. I looks like the output for GRASS_SCRIPTS is "chopped up" and
messy, and I don't know how this could happen.
How can I clean up my gisenv as I think that might solve the problem?
Whats the best way? My ADDON_PATH is extremely long and repeatedly the
same. Furthermore it seems there is a line break in gisenv dividing "r"
and "adinger...", which is causing the problem above.
I still don't know how this could happen as I never touched the
gisenv deliberately.
Replying to [comment:12 jradinger]:
>
> How can I clean up my gisenv as I think that might solve the problem?
Whats the best way? My ADDON_PATH is extremely long and repeatedly the
same. Furthermore it seems there is a line break in gisenv dividing "r"
and "adinger...", which is causing the problem above.
>
> I still don't know how this could happen as I never touched the
> gisenv deliberately.
The repetitions in ADDON_PATH could be caused by a bug in g.extension. You
could try to manually edit `~/.grass7/rc`.
Replying to [comment:12 jradinger]:
> sorry for responding so late.
ditto, better a late response than none
> How can I clean up my gisenv as I think that might solve the
> problem? Whats the best way? My ADDON_PATH is extremely long
> and repeatedly the same. Furthermore it seems there is a line
> break in gisenv dividing "r" and "adinger...", which is causing
> the problem above.
see comment:5.
MarkusM wrote:
> You could try to manually edit ~/.grass7/rc.
In GRASS 6 the file is ~/.grassrc6, and you should not be in a GRASS
session when you edit it.
I have had another attempt at making v.db.addcol more robust to external
g.gisenv problems in r55162,3. This report should stay open until the
other ~36 scripts that use `eval g.gisenv` but only really need one
variable from it have been checked/fixed. Spaces and other fun chars in
GISDBASE will make eval unhappy.
Replying to [comment:12 jradinger]:
> sorry for responding so late.
ditto, better a late response than none
> How can I clean up my gisenv as I think that might solve the
> problem? Whats the best way? My ADDON_PATH is extremely long
> and repeatedly the same. Furthermore it seems there is a line
> break in gisenv dividing "r" and "adinger...", which is causing
> the problem above.
see comment:5.
MarkusM wrote:
> You could try to manually edit ~/.grass7/rc.
In GRASS 6 the file is ~/.grassrc6, and you should not be in a GRASS
session when you edit it.
Thank you and Markus M. for the instruction. I've cleaned my ~/.grassrc6 and
don't get any error messages anymore when i try to use v.db.addcol.
Johannes
I have had another attempt at making v.db.addcol more robust to external
g.gisenv problems in r55162,3. This report should stay open until the
other ~36 scripts that use `eval g.gisenv` but only really need one
variable from it have been checked/fixed. Spaces and other fun chars in
GISDBASE will make eval unhappy.
scripts in devbr6 now updated with r55194:55226, but need testing before
backport to the stable branch.
AFAICT the only ones which will actually trigger run-time processing
errors (instead of just the occasional harmless message) on WinGrass w/
spaces in GISDBASE, are:
* r.pack/unpack (already backported)
* r.in.srtm
* db.droptable
* d.rast.leg (bug? try erode.index@spearfish)
* r.in.wms
* i.image.mosaic
* v.in.garmin (doesn't need to be fixed for wingrass as dep req's UNIX)
so those should be tested & then backported for 6.4.3.
the rest can wait until after the freeze and go in for 6.4.4.