GRASS Backend Error: Unable to determine user's home directory.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

GRASS Backend Error: Unable to determine user's home directory.

swainn
Forum:

I am using WPS 3.3.1 on Ubuntu 14.04 with Tomcat 7. I compiled PROJ, GEOS, GDAL, and GRASS from source with the following versions:

PROJ: 4.8
GEOS: 3.4.2
GDAL: 1.11
GRASS: 7.0.1

I have inadvertently upgraded GRASS from 7.0.0 to 7.0.1. After this upgrade many of the test processes from the form client that were working with 7.0.0, encountered an error with 7.0.1. The primary error given by the GRASS log is: "Unable to determine user's home directory."

Has anyone encountered this issue and found a workaround? Alternatively, I'd be happy to use GRASS 7.0.0, but I don't know how to install that version, because 7.0.1 is installed automatically when I pull the grass70_release branch. It seems @mwaurah has encountered this same issue recently: https://lists.wald.intevation.org/pipermail/pywps-devel/2015-May/001792.html

As an example, here is the WPS exception and GRASS log I get when trying to execute the "v.buffer_request_out_gml.xml" request:

<ows:ExceptionReport version="1.0.0">
    <ows:Exception exceptionCode="NoApplicableCode">
        <ows:ExceptionText>
            Error while executing the embedded process for: v.buffer
        </ows:ExceptionText>
    </ows:Exception>
    <ows:Exception exceptionCode="JAVA_StackTrace">
        <ows:ExceptionText>
            org.n52.wps.server.ExceptionReport: Error while executing the embedded process for: v.buffer
	    at org.n52.wps.server.request.ExecuteRequest.call(ExecuteRequest.java:716)
	    at org.n52.wps.server.request.ExecuteRequest.call(ExecuteRequest.java:92)
	    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	    at java.lang.Thread.run(Thread.java:745)
            Caused by: java.lang.RuntimeException: An error occured while executing the GRASS GIS process. See the log under http://localhost:8080/wps/GRASS_LOGS/e3fc9ca.log for more details.
	    at org.n52.wps.server.grass.io.GrassIOHandler.executeGrassModuleStarter(GrassIOHandler.java:617)
	    at org.n52.wps.server.grass.io.GrassIOHandler.executeGrassProcess(GrassIOHandler.java:151)
	    at org.n52.wps.server.grass.GrassProcessDelegator.run(GrassProcessDelegator.java:224)
	    at org.n52.wps.server.request.ExecuteRequest.call(ExecuteRequest.java:685)
	    ... 5 more
        </ows:ExceptionText>
    </ows:Exception>
    <ows:Exception exceptionCode="JAVA_RootCause">
        <ows:ExceptionText>
            An error occured while executing the GRASS GIS process. See the log under http://localhost:8080/wps/GRASS_LOGS/e3fc9ca.log for more details.
        </ows:ExceptionText>
        <ows:ExceptionText>
            java.lang.RuntimeException: An error occured while executing the GRASS GIS process. See the log under http://localhost:8080/wps/GRASS_LOGS/e3fc9ca.log for more details.
	    at org.n52.wps.server.grass.io.GrassIOHandler.executeGrassModuleStarter(GrassIOHandler.java:617)
	    at org.n52.wps.server.grass.io.GrassIOHandler.executeGrassProcess(GrassIOHandler.java:151)
	    at org.n52.wps.server.grass.GrassProcessDelegator.run(GrassProcessDelegator.java:224)
	    at org.n52.wps.server.request.ExecuteRequest.call(ExecuteRequest.java:685)
	    at org.n52.wps.server.request.ExecuteRequest.call(ExecuteRequest.java:92)
	    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	    at java.lang.Thread.run(Thread.java:745)
        </ows:ExceptionText>
    </ows:Exception>
</ows:ExceptionReport>

The GRASS log has the following contents:

<INFO timestamp="19:3:8">
Vector map is of type {'MIMETYPE': 'TEXT/XML', 'GDALID': 'GML', 'SCHEMA': 'GML'}
</INFO>

<INFO timestamp="19:3:8">
Check if a band number is present
</INFO>

<INFO timestamp="19:3:8">
No band number found
</INFO>

<INFO timestamp="19:3:8">
Check for multiple import
</INFO>

<INFO timestamp="19:3:8">
No inputs found
</INFO>

<INFO timestamp="19:3:8">
GRASS_ADDON_PATH=
</INFO>

<INFO timestamp="19:3:8">
PYTHONPATH=:/usr/local/grass-7.0.1svn/etc/python:/usr/local/grass-7.0.1svn/etc/python:/usr/lib/python2.7
</INFO>

<INFO timestamp="19:3:8">
GISRC=/var/grass/tmp/tmpDHABTv/gisrc
</INFO>

<INFO timestamp="19:3:8">
GRASS_VERSION=7.0.svn:7.0.svn
</INFO>

<INFO timestamp="19:3:8">
PATH=/usr/local/grass-7.0.1svn/bin:/usr/local/grass-7.0.1svn/scripts:/usr/local/grass-7.0.1svn/lib:/usr/local/grass-7.0.1svn/bin:/usr/local/grass-7.0.1svn/scripts:/usr/bin:/usr/local/grass-7.0.1svn/extralib:/usr/local/grass-7.0.1svn/extrabin
</INFO>

<INFO timestamp="19:3:8">
GIS_LOCK=321
</INFO>

<INFO timestamp="19:3:8">
LD_LIBRARY_PATH=/usr/local/grass-7.0.1svn/lib:/usr/local/grass-7.0.1svn/lib
</INFO>

<INFO timestamp="19:3:8">
GISBASE=/usr/local/grass-7.0.1svn
</INFO>

<INFO timestamp="19:3:8">
LOCATION_NAME: startLocation
MAPSET: PERMANENT
DIGITIZER: none
GISDBASE: /var/grass/tmp/tmpDHABTv
OVERWRITE: 1
DEBUG: 0
GRASS_GUI: text
</INFO>

<INFO timestamp="19:3:8">
Created gisrc file /var/grass/tmp/tmpDHABTv/gisrc
</INFO>

<INFO timestamp="19:3:8">
Created WIND file /var/grass/tmp/tmpDHABTv/startLocation/PERMANENT/WIND
</INFO>

<INFO timestamp="19:3:8">
Created VAR file /var/grass/tmp/tmpDHABTv/startLocation/PERMANENT/VAR
</INFO>

<INFO timestamp="19:3:8">
inputs
</INFO>

<INFO timestamp="19:3:8">
Input file: /tmp/tomcat7-tomcat7-tmp/Shape_cf811725-a74e-4dac-b406-2cd37c0f88432038429691087173007.shp
Mime type: APPLICATION/SHP
</INFO>

<INFO timestamp="19:3:8">
LOCATION_NAME: startLocation
MAPSET: PERMANENT
DIGITIZER: none
GISDBASE: /var/grass/tmp/tmpDHABTv
OVERWRITE: 1
DEBUG: 0
GRASS_GUI: text
</INFO>

<INFO timestamp="19:3:8">
Vector map is of type {'MIMETYPE': 'APPLICATION/SHP', 'GDALID': 'ESRI_Shapefile', 'SCHEMA': ''}
</INFO>

<INFO timestamp="19:3:8">
Creating input location
</INFO>

<INFO timestamp="19:3:8">
Vector map is of type {'MIMETYPE': 'APPLICATION/SHP', 'GDALID': 'ESRI_Shapefile', 'SCHEMA': ''}
</INFO>

<INFO timestamp="19:3:8">
Looking for ##/usr/local/grass-7.0.1svn/bin/v.in.ogr##
</INFO>

<INFO timestamp="19:3:8">
GRASS module path is /usr/local/grass-7.0.1svn/bin/v.in.ogr
</INFO>

<INFO timestamp="19:3:8">
Run process: ['/usr/local/grass-7.0.1svn/bin/v.in.ogr', 'dsn=/tmp/tomcat7-tomcat7-tmp/Shape_cf811725-a74e-4dac-b406-2cd37c0f88432038429691087173007.shp', 'location=workLocation', '-ie']
</INFO>

<INFO timestamp="19:3:8">
Process pid: 324
</INFO>

<INFO timestamp="19:3:8">
Return code: 0
</INFO>

<INFO timestamp="19:3:8">
WARNING: Please update the usage of <v.in.ogr>: option <dsn> has been
         renamed to <input>
WARNING: All available OGR layers will be imported into vector map
         <Shape_cf811725-a74e-4dac-b406-2cd37c0f88432038429691087173007>
WARNING: Datum <WGS84> not recognised by GRASS and no parameters found
Location <workLocation> created

</INFO>

<INFO timestamp="19:3:8">
LOCATION_NAME: workLocation
MAPSET: PERMANENT
DIGITIZER: none
GISDBASE: /var/grass/tmp/tmpDHABTv
OVERWRITE: 1
DEBUG: 0
GRASS_GUI: text
</INFO>

<INFO timestamp="19:3:8">
Looking for ##/usr/local/grass-7.0.1svn/bin/db.connect##
</INFO>

<INFO timestamp="19:3:8">
GRASS module path is /usr/local/grass-7.0.1svn/bin/db.connect
</INFO>

<INFO timestamp="19:3:8">
Run process: ['/usr/local/grass-7.0.1svn/bin/db.connect', '-d']
</INFO>

<INFO timestamp="19:3:8">
Process pid: 325
</INFO>

<INFO timestamp="19:3:8">
Return code: 1
</INFO>

<INFO timestamp="19:3:8">
ERROR: Unable to determine user's home directory

</INFO>

<INFO timestamp="19:3:8">
Vector map is of type {'MIMETYPE': 'APPLICATION/SHP', 'GDALID': 'ESRI_Shapefile', 'SCHEMA': ''}
</INFO>

<INFO timestamp="19:3:8">
Import vector map input
</INFO>

<INFO timestamp="19:3:8">
Looking for ##/usr/local/grass-7.0.1svn/bin/v.in.ogr##
</INFO>

<INFO timestamp="19:3:8">
GRASS module path is /usr/local/grass-7.0.1svn/bin/v.in.ogr
</INFO>

<INFO timestamp="19:3:8">
Run process: ['/usr/local/grass-7.0.1svn/bin/v.in.ogr', 'dsn=/tmp/tomcat7-tomcat7-tmp/Shape_cf811725-a74e-4dac-b406-2cd37c0f88432038429691087173007.shp', 'output=input']
</INFO>

<INFO timestamp="19:3:8">
Process pid: 326
</INFO>

<INFO timestamp="19:3:8">
Return code: 1
</INFO>

<INFO timestamp="19:3:8">
WARNING: Please update the usage of <v.in.ogr>: option <dsn> has been
         renamed to <input>
WARNING: Datum <WGS84> not recognised by GRASS and no parameters found
Check if OGR layer
<Shape_cf811725-a74e-4dac-b406-2cd37c0f88432038429691087173007> contains
polygons...
   0%   7%  14%  21%  28%  35%  42%  50%  57%  64%  71%  78%  85%  92% 100%
ERROR: Unable to determine user's home directory

</INFO>

<ERROR timestamp="19:3:8">
Unable to import input OGR log: WARNING: Please update the usage of <v.in.ogr>: option <dsn> has been
         renamed to <input>
WARNING: Datum <WGS84> not recognised by GRASS and no parameters found
Check if OGR layer
<Shape_cf811725-a74e-4dac-b406-2cd37c0f88432038429691087173007> contains
polygons...
   0%   7%  14%  21%  28%  35%  42%  50%  57%  64%  71%  78%  85%  92% 100%
ERROR: Unable to determine user's home directory

</ERROR>

<INFO timestamp="19:3:8">
Remove /var/grass/tmp/tmpDHABTv
</INFO>

Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GRASS Backend Error: Unable to determine user's home directory.

BenjaminPross
Hi Nathan,

I am not yet sure what is going wrong there, but here is a workaround:

In the GrassModuleStarte.py, explicitly set the HOME environment variable.

I.e. in the _setEnvironment method circa line 425, add:

        self.genv.env["HOME"] = "/home/your_username"
               
Hope this helps.

Cheers,

Benjamin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GRASS Backend Error: Unable to determine user's home directory.

swainn
Benjamin,

That did the trick. Thank you for your help and speedy resonse.

--
Nathan
Loading...