Skip to content

[Bug] t.connect: inconstisten return after leaving #7538

Closed

Description

@ninsbl

Describe the bug

t.connect returns inconsistent (or at least unexpectedly changed) output after attempting to print connection information in shell style.
Running:

t.connect -pg
t.connect -g
t.connect -pg

Returns first empty keys, so nothing, so keys with default values assigned. Yet no TGIS DB is created (which is good).
t.connect may be used to quickly check if STDS may exist in the mapset. However, this inconsistency may make such a check less reliable...

To reproduce

# Create project
$ grass -c EPSG:4326 /tmp/WGS84 -e
# Create an empty mapset
$ grass -c /tmp/WGS84/t_connect -e
# Print TGIS connection in shell format (note the empty fields)
$ grass /tmp/WGS84/t_connect --exec t.connect -pg
driver=
database=
# List mapset content (no TGIS DB created)
$ ls -a /tmp/WGS84/t_connect
.  ..  sqlite  .tmp  VAR  WIND
# Run t.connect only with the -g flag (no return)
$ grass /tmp/WGS84/t_connect --exec t.connect -g
# List mapset content (still no TGIS DB created)
$ ls -a /tmp/WGS84/t_connect
.  ..  sqlite  .tmp  VAR  WIND
# Notice the different output when of t.connect -pg
$ grass /tmp/WGS84/t_connect --exec t.connect -pg
driver=sqlite
database=$GISDBASE/$LOCATION_NAME/$MAPSET/tgis/sqlite.db

Expected behavior

Unless no TGIS DB connection is explicitly created/configured by the user, output should be consistently empty, indicating a that no TGIS connection is configured for the mapset (and thus no STDS exist).

System description

  • Operating System: Fedora Linux 42
  • GRASS version: 8.6

Additional information

This can probably be addressed when JSON format is implemented...

Activity

  1. added this to the 8.6.0 milestone on Jun 11, 2026
  2. added
    bug
    temporal
    on Jun 11, 2026
  3. added theissue type on Jun 11, 2026
  4. petrasovaa commented on Jun 12, 2026

    @petrasovaa
    Contributor

    It looks like the -g flag creates or edits the VAR file writing the connection in there but actually not creating the database. It should not create/edit the VAR file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtemporal

    Type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions