[GRASS-user] Create location fails in docker

Moritz Lennert mlennert at club.worldonline.be
Thu Sep 30 01:49:26 PDT 2021


Hi Madi,

Am 30.09.2021 09:46 schrieb Margherita Di Leo:
> Hi again,
> 
> I try to reformulate my question:
> 
> On Wed, Sep 29, 2021 at 9:32 PM Margherita Di Leo <diregola at gmail.com>
> wrote:
> 
>> grass --text -c EPSG:4326 $GRASSDATA/france -e
>> 
>> The error message:
>> 
>> Traceback (most recent call last):
>> File "/usr/bin/grass", line 390, in get_grass_config_dir
>> os.mkdir(directory)
>> PermissionError: [Errno 13] Permission denied: '/.grass7'
>> 
>> During handling of the above exception, another exception occurred:
>> 
>> Traceback (most recent call last):
>> File "/usr/bin/grass", line 2218, in <module>
>> main()
>> File "/usr/bin/grass", line 2001, in main
>> grass_config_dir = get_grass_config_dir()
>> File "/usr/bin/grass", line 395, in get_grass_config_dir
>> _("Failed to create configuration directory '%s' with error:
>> %s")
>> NameError: name '_' is not defined
>> Traceback (most recent call last):
>> File "/usr/bin/grass", line 390, in get_grass_config_dir
>> os.mkdir(directory)
>> PermissionError: [Errno 13] Permission denied: '/.grass7'
> 
> What does this error message mean? Why is it trying to write in the
> /.grass7 folder ?

Whenever you launch GRASS GIS with the grass startup script, it writes 
the chosen Gisdbase/Location/Mapset info into .grass7/rc. If you launch 
GRASS GIS for the first time, it first creates the directory .grass7 
which is the part that fails with a permission error.

I'm no Docker expert at all, but I think you have to explicitly run the 
container with parameters indicating the devices one can access from 
within.

> And what does the name '_' refer to?

This seems to be linked to the translation handling:

>> File "/usr/bin/grass", line 395, in get_grass_config_dir
>> _("Failed to create configuration directory '%s' with error:
>> %s")

Note the '_' in front of the string which marks it as a translatable 
string.

There was a bug related to this a while ago, but it was fixed 
(https://trac.osgeo.org/grass/ticket/3875). Maybe a locale issue ?

Moritz


More information about the grass-user mailing list