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

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@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@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

On Mon, Nov 12, 2018 at 4:24 PM Nikos Alexandris <nik@nikosalexandris.net> wrote:

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:

In your case, it seems to be an incomplete GRASS installation, see below:

[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

granted that “grass” is a link to “grass77”, the GRASS python lib is missing, should be here: ‘dist.x86_64-pc-linux-gnu/etc/python/grass/’

another missing ‘dist.x86_64-pc-linux-gnu/etc/’ file:

IOError: [Errno 2] No such file or directory: 'dist.x86_64-pc-linux-gnu/etc/license'

maybe you need to check your GRASS installation for completeness

Markus M

grassyan@2ced1e57a44e:~$ grass74 --version
GRASS GIS 7.4.2
Traceback (most recent call last):
File “/usr/bin/grass74”, line 2027, in
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 …
Traceback (most recent call last):
File “/usr/local/bin/grass77”, line 2242, in
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
_______________________________________________
grass-dev mailing list
[grass-dev@lists.osgeo.org](mailto:grass-dev@lists.osgeo.org)
[https://lists.osgeo.org/mailman/listinfo/grass-dev](https://lists.osgeo.org/mailman/listinfo/grass-dev)

* Markus Metz <markus.metz.giswork@gmail.com> [2018-11-12 17:04:28 +0100]:

On Mon, Nov 12, 2018 at 4:24 PM Nikos Alexandris <nik@nikosalexandris.net>
wrote:

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:

In your case, it seems to be an incomplete GRASS installation, see below:

Thank you for the attention Markus! I use the same configuration and
compilation script, locally and for the docker. Maybe a network failure
or differences between Funtoo and Debian then. Hmm.. or I messed too
much with ENV and variables, i.e. the "$GISBASE" one. It must be this!

[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
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

granted that “grass” is a link to “grass77”,

It is:

root@e326865a0b0e:~# ls -l /usr/local/bin/
total 1
lrwxrwxrwx 1 root root 22 Nov 12 14:58 grass → /usr/local/bin/grass77
lrwxrwxrwx 1 root root 63 Nov 12 14:58 grass77 → /home/grassyan/osgeo/grasstrunk/bin.x86_64-pc-linux-gnu/grass77

Nikos

the GRASS python lib is
missing, should be here: ‘dist.x86_64-pc-linux-gnu/etc/python/grass/’

another missing ‘dist.x86_64-pc-linux-gnu/etc/’ file:

IOError: \[Errno 2\] No such file or directory:

'dist.x86_64-pc-linux-gnu/etc/license'

maybe you need to check your GRASS installation for completeness

Markus M

grassyan@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
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

--
Nikos Alexandris | Remote Sensing & Geomatics
GPG Key Fingerprint 6F9D4506F3CA28380974D31A9053534B693C4FB3

Finally, it was a problem of the `GISBASE` environment variable.
All fixed now.

Thanks again, Nikos