[GRASS-dev] Location creation failure in docker with latest grass trunk version

Nikos Alexandris nik at nikosalexandris.net
Mon Nov 12 07:24:36 PST 2018


Hi, this is maybe similar to ticket #3693 [0].

@neteler In [0], the first example to create a Location, is performed as
root. Curious, why so? Why not as a simple user?

I just try to update my grassyan Dockerfile [0] and it fails at the
point of creating a Location, for the sake of testing. I don't know if
this is relevant with what is reported in ticket #3693:

[0] https://trac.osgeo.org/grass/ticket/3693
[1] https://gitlab.com/NikosAlexandris/grassyan

```
Step 47/52 : RUN grass -text -e     -c EPSG:4326     "$GRASSDB/$TEMPORARY_MAPSET" RUN  grass -text     "$GRASSDB/$TEMPORARY_MAPSET/PERMANENT"     --exec g.region -p
 ---> Running in 4dab4125dec7
Starting GRASS GIS...
Creating new GRASS GIS location <temporary_Mapset>...
Traceback (most recent call last):
  File "/usr/local/bin/grass", line 2242, in <module>
    main()
  File "/usr/local/bin/grass", line 2153, in main
    geofile=params.geofile, create_new=True)
  File "/usr/local/bin/grass", line 1046, in set_mapset
    create_location(gisdbase, location_name, geofile)
  File "/usr/local/bin/grass", line 837, in create_location
    from grass.script import core as gcore  # pylint: disable=E0611
ImportError: No module named grass.script
The command '/bin/sh -c grass -text -e     -c EPSG:4326     "$GRASSDB/$TEMPORARY_MAPSET" RUN  grass -text     "$GRASSDB/$TEMPORARY_MAPSET/PERMANENT"     --exec g.region -p' returned a non-zero code: 1
```

Don't mind the misleading `temporary_Mapset` name, it should be
`temporary_Location` instead. Even interactively, creating a Location
will fail too:
```
grassyan at 2ced1e57a44e:~$ grass --version
GRASS GIS 7.7.svn
Traceback (most recent call last):
  File "/usr/local/bin/grass", line 2242, in <module>
    main()
  File "/usr/local/bin/grass", line 2040, in main
    params = parse_cmdline(sys.argv[1:], default_gui=default_gui)
  File "/usr/local/bin/grass", line 1940, in parse_cmdline
    message('\n' + readfile(gpath("etc", "license")))
  File "/usr/local/bin/grass", line 263, in readfile
    f = open(path, 'r')
IOError: [Errno 2] No such file or directory: 'dist.x86_64-pc-linux-gnu/etc/license'
grassyan at 2ced1e57a44e:~$ grass74 --version
GRASS GIS 7.4.2
Traceback (most recent call last):
  File "/usr/bin/grass74", line 2027, in <module>
    main()
  File "/usr/bin/grass74", line 1839, in main
    params = parse_cmdline(sys.argv[1:], default_gui=default_gui)
  File "/usr/bin/grass74", line 1744, in parse_cmdline
    message('\n' + readfile(gpath("etc", "license")))
  File "/usr/bin/grass74", line 229, in readfile
    f = open(path, 'r')
IOError: [Errno 2] No such file or directory: 'dist.x86_64-pc-linux-gnu/etc/license'
```
and
```
grass77 -c 'epsg:4326' /home/grassyan/grassdb/test
Starting GRASS GIS...
WARNING: GRASS GUI not found. Please check your installation.
Switching to text based interface mode.

Hit RETURN to continue.


Creating new GRASS GIS location <test>...
Traceback (most recent call last):
  File "/usr/local/bin/grass77", line 2242, in <module>
    main()
  File "/usr/local/bin/grass77", line 2153, in main
    geofile=params.geofile, create_new=True)
  File "/usr/local/bin/grass77", line 1046, in set_mapset
    create_location(gisdbase, location_name, geofile)
  File "/usr/local/bin/grass77", line 837, in create_location
    from grass.script import core as gcore  # pylint: disable=E0611
ImportError: No module named grass.script
```

Nikos


More information about the grass-dev mailing list