id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,cpu,platform 3252,Provide an error message pointing out that session is not active,wenzeslaus,grass-dev@…,"When you run {{{ grass73 ~/grassdata/nc_spm_08_grass7/user1 --exec d.mon wx0 }}} it gives {{{ ERROR: Variable 'LOCATION_NAME' not set }}} it also prints {{{ Traceback (most recent call last): File ""/home/vpetras/dev/grass/gcc_trunk/dist.x86_64-pc-linux-gnu/gui/wxpython/mapdisp/main.py"", line 608, in fd = open(pidFile, 'w') IOError: [Errno 2] No such file or directory: '/home/vpetras/grassdata/nc_spm_08_grass7/user1/.tmp/lemur/MONITORS/wx0/pid' }}} but what it is trying to say is that there is not running in an active GRASS GIS session (session ended but d.mon wx0 runs in the background). Similar situation can be created in Python using: {{{ #!python import os import sys import subprocess # create GRASS GIS runtime environment gisbase = subprocess.check_output([""grass"", ""--config"", ""path""]).strip() os.environ['GISBASE'] = gisbase sys.path.append(os.path.join(gisbase, ""etc"", ""python"")) # do GRASS GIS imports import grass.script as gs import grass.script.setup as gsetup # set GRASS GIS session data rcfile = gsetup.init(gisbase, ""/home/vpetras/grassdata"", ""nc_spm_08_grass7"", ""user1"") # run module gs.parse_command('g.region', region=""swwake_30m"", flags='pg') # end the GRASS session os.remove(rcfile) # run module again gs.parse_command('g.region', region=""swwake_30m"", flags='pg') }}} The error is again (possibly with traceback): {{{ ERROR: Variable 'LOCATION_NAME' not set }}} But it should be one of those (or any other you think is better): {{{ ERROR: No GRASS GIS session is not active: Variable 'LOCATION_NAME' not set ERROR: Variable 'LOCATION_NAME' not set. Are you in GRASS GIS session? ERROR: Variable 'LOCATION_NAME' not set. Are you running GRASS GIS session? ERROR: Not running in a GRASS GIS session (variable 'LOCATION_NAME' not set) }}} ",defect,new,normal,7.2.4,Startup,unspecified,,"GRASS GIS environment variables, g.gisenv, G_getenv, G_getenv_nofatal, G_fatal_error, fatal error, LOCATION_NAME, session",,Unspecified,Unspecified