Opened 9 years ago

Closed 8 years ago

#2683 closed defect (fixed)

grass 7 doesn't start in text mode on CentOS 7

Reported by: morenocomelli Owned by: grass-dev@…
Priority: normal Milestone: 7.0.5
Component: Startup Version: svn-trunk
Keywords: centos Cc:
CPU: Unspecified Platform: Unspecified

Description

I'm trying to start grass 7 on CentOS 7 in text mode (Grass 6.4.4 installed via yum works correctly). On Centos with GUI:

# grass70 -text
ERROR: Unable to start GRASS. You can:
 - Launch GRASS with '-gui' switch (`grass70 -gui`)
 - Create manually GISRC file (/root/.grass7/rc)
 - Launch GRASS with path to the location/mapset as an argument (`grass70 /path/to/location/mapset`)
Exiting...

On CentOS without GUI:

# grass70 -text
WARNING: Searched for a web browser, but none found
ERROR: Unable to start GRASS. You can:
 - Launch GRASS with '-gui' switch (`grass70 -gui`)
 - Create manually GISRC file (/root/.grass7/rc)
 - Launch GRASS with path to the location/mapset as an argument (`grass70 /path/to/location/mapset`)
Exiting...
#grass70
WARNING: Searched for a web browser, but none found
Starting GRASS GIS...
WARNING: It appears that the X Windows system is not active.
A graphical based user interface is not supported.
Switching to text based interface mode.

Hit RETURN to continue

ERROR: Path '/home/download/grass-7.0.0/<UNKNOWN>/<UNKNOWN>' doesn't exist
Exiting...

Change History (23)

comment:1 by neteler, 9 years ago

Component: DefaultStartup
Keywords: centos added
Version: unspecified7.0.0

comment:2 by wenzeslaus, 9 years ago

The behavior should be same for system with and without GUI if -text is used. Except for the warnings about browser and X. It seems that this is true. Perhaps the warnings shouldn't be there in the text mode since they are useless and probably annoying. Would you like to have them removed when -text? But note that the issue is that you can start with -text and then open some GUI (quite common usage) and in this case the warnings are quite useful.

In both cases it prints the same message with suggestion what can be done to start GRASS GIS. This is perhaps the important difference to GRASS GIS 6.4 where a text-based interface was started. There is none like this in 7.0. The -text interface means command line parameters of grass70 and command line inside GRASS session.

I'm not sure with the other error you are getting. It seems that when you start for the second time on the same machine after unsuccessful first start, you get different error which does not have any suggestions how to fix it. I think this is wrong but I'm actually not sure how this happens. I'm not completely sure what is the purpose of UNKNOWN strings in the rc file and how they get there (there is a create_initial_gisrc() function but I though the created file conntent is always used only internally by grass.py).

comment:3 by neteler, 9 years ago

Milestone: 7.0.17.0.2

Ticket retargeted after 7.0.1 milestone closed

comment:4 by neteler, 8 years ago

Milestone: 7.0.27.0.3

Ticket retargeted after milestone closed

in reply to:  description comment:5 by morenocomelli, 8 years ago

Same problem with GRASS 7.0.2 and GRASS 7.1.
GRASS looks for location and mapset, and since there are none defined when starting the first time, the error appears (in text mode only).
If mapset and location are created through gui, at next start in text mode they're the default settings. An other option is to create the /root/.grass7/rc file with proper parameters and the missing part of dir tree (the supposed dirs with database, location and mapset).

Last edited 8 years ago by morenocomelli (previous) (diff)

comment:6 by neteler, 8 years ago

From a (new) user's point of view, the initial part of the message

"ERROR: Unable to start GRASS."

is a bit scary. It needs to be expanded and more friendly. Especially the word "ERROR" must be removed. Proposal, let's change it into something like

"Welcome - You seem to run GRASS GIS the first time. Some settings need to be defined first. For this you can:"

Any better suggestions?

in reply to:  6 comment:7 by neteler, 8 years ago

Replying to neteler:

From a (new) user's point of view, the initial part of the message

"ERROR: Unable to start GRASS."

is a bit scary. It needs to be expanded and more friendly. Especially the word "ERROR" must be removed. Proposal, let's change it into something like

"Welcome - You seem to run GRASS GIS the first time. Some settings need to be defined first. For this you can:"

To be changed in

lib/init/grass.py" line 1791

comment:8 by neteler, 8 years ago

Milestone: 7.0.3

Ticket retargeted after milestone closed

comment:9 by neteler, 8 years ago

Milestone: 7.0.4

Ticket retargeted after 7.0.3 milestone closed

comment:10 by martinl, 8 years ago

Milestone: 7.0.47.0.5

comment:11 by rbarnes, 8 years ago

Just wanted to note that I am trying to figure out how to use GRASS for the first time today. And I want to use it from the command line.

I am getting:

ERROR: Unable to start GRASS. You can:
 - Launch GRASS with '-gui' switch (`grass70 -gui`)
 - Create manually GISRC file (/home/my_user/.grass7/rc)
 - Launch GRASS with path to the location/mapset as an argument (`grass70 /path/to/location/mapset`)
Exiting...

and, from this text, have absolutely no idea what to do. Searching the internet based on these phrases has brought me here.

Creating an empty rc file yields nothing. Trying to point GRASS at a directory results in it telling me that said directory (seemingly no matter what it is) is an invalid GRASS location.

in reply to:  11 comment:12 by neteler, 8 years ago

Replying to rbarnes:

Just wanted to note that I am trying to figure out how to use GRASS for the first time today. And I want to use it from the command line.

I am getting:

ERROR: Unable to start GRASS. You can:
 - Launch GRASS with '-gui' switch (`grass70 -gui`)

... did you try this?

See also:

https://grass.osgeo.org/grass70/manuals/helptext.html

How should we modify the message?

comment:13 by rbarnes, 8 years ago

I'm running GRASS on a headless machine, so it wasn't possible for me to use a GUI on it.

I ended up installing GRASS on a spare machine, installing all the GUI packages, using the GUI, and then copying the contents of the resultant RC file and the associated directory structure to the headless machine.

I have not found instructions for "Create manually GISRC file", but, if those existed somewhere and the help text referenced them, that would be ideal.

in reply to:  13 ; comment:14 by neteler, 8 years ago

Replying to rbarnes:

I'm running GRASS on a headless machine, so it wasn't possible for me to use a GUI on it.

Right.

On headless machines, use

grass70 /path/to/location/mapset

and the rc file will be generated.

I ended up installing GRASS on a spare machine, installing all the GUI packages, using the GUI, and then copying the contents of the resultant RC file and the associated directory structure to the headless machine.

I have not found instructions for "Create manually GISRC file", but, if those existed somewhere and the help text referenced them, that would be ideal.

comment:15 by rbarnes, 8 years ago

That resulted in:

ERROR: ERROR: </home/myuser> is not a valid GRASS location

in reply to:  14 comment:16 by mlennert, 8 years ago

Replying to neteler:

Replying to rbarnes:

I'm running GRASS on a headless machine, so it wasn't possible for me to use a GUI on it.

Right.

On headless machines, use

grass70 /path/to/location/mapset

and the rc file will be generated.

If you have no existing GRASS DATABASE, yet, on the machine, I would recommend starting by creating one:

mkdir GRASSDATA

Then, if you have no existing GRASS GIS data, you have to create a location and mapset first. Locations are defined by their projection system. Two options exist to define this projection: either you use an existing georeferenced file, or you use an EPSG code (see grass70 --help for details).

grass70 -c EPSG:32630 /home/myuser/GRASSDATA/mylocation

will create the location 'mylocation' (using WGS 84 / UTM zone 30N projection) and the mapset PERMANENT.

If you want to enter the same location, but in a newly created mapset:

grass70 -c /home/myuser/GRASSDATA/mylocation/mymapset

If you want to create a new location (which always needs a PERMANENT mapset) and immediately enter another newly created mapset, you can combine these two steps

grass70 -e -c EPSG:32630 /home/mlennert/gg/mylocation grass70 -c /home/myuser/GRASSDATA/mylocation/mymapset

The '-e' flag tells GRASS to just create the new location (with its PERMANENT mapset), and then exit. The second call then creates and enters the new mapset mymapset.

comment:17 by rbarnes, 8 years ago

Thanks. But I'm not sure how someone new to GRASS is supposed to know the foregoing. Perhaps by searching they will find this info here.

in reply to:  17 comment:18 by neteler, 8 years ago

Version: 7.0.0svn-trunk

Replying to rbarnes:

Thanks. But I'm not sure how someone new to GRASS is supposed to know the foregoing. Perhaps by searching they will find this info here.

Sure, the idea is to improve the message. Now (r68795) it reads:

grass73
ERROR: Unable to start GRASS GIS. You have the choice to:
 - Launch the GRASS GIS interface with the '-gui' switch (`grass73 -gui`)
 - Launch GRASS GIS directly with path to the location/mapset as an argument (`grass73 /path/to/location/mapset`)
 - Create manually the GISRC file (/home/user/.grass7/rc)
See also: https://grass.osgeo.org/grass73/manuals/helptext.html
Exiting...

(manual page URL added).

Any missing text from comment:16 should be added to that manual page.

If this modified error message is ok, I'll backport it. Otherwise please suggest rephrasing.

comment:19 by wenzeslaus, 8 years ago

In 68797:

init: advise user about --help and -c

make messages shorter
follows r68795, see #2683

comment:20 by mlennert, 8 years ago

In r68808 I've added a section on text-based startup with location creation.

in reply to:  20 comment:21 by neteler, 8 years ago

Replying to mlennert:

In r68808 I've added a section on text-based startup with location creation.

Minor adjustments in r68809 (consistency with graphical part).

All backported to 7.2.svn in r68810 and to 7.0.svn in r68811.

@morenocomelli: is it ok now like this and the ticket can be closed?

comment:22 by rbarnes, 8 years ago

These changes look quite reasonable to me. Thanks so much!

in reply to:  22 comment:23 by neteler, 8 years ago

Resolution: fixed
Status: newclosed

Replying to rbarnes:

These changes look quite reasonable to me. Thanks so much!

Great. Thanks for your report. Closing.

Note: See TracTickets for help on using tickets.