Opened 4 years ago

Closed 14 months ago

#2984 closed defect (fixed)

i.colors.enhance crash when input map(s) not existing

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.2.4
Component: Python Version: svn-releasebranch70
Keywords: i.colors.enhance, multiprocessing Cc:
CPU: All Platform: All

Description

An error catch is needed:

GRASS 7.0.4svn (utm21S-sentinel-2-buenos-aires):~ > i.colors.enhance b=S2A_USER_MSI_L2A_TL_SGS__20151211T193047_A002452_B03_10m_mosaik g=S2A_USER_MSI_L2A_TL_SGS__20151211T193047_A002452_B04_10m_mosaik r=S2A_USER_MSI_L2A_TL_SGS__20151211T193047_A002452_B8A_10m_mosaik
Processing...
FEHLER: Rasterkarte
        <S2A_USER_MSI_L2A_TL_SGS__20151211T193047_A002452_B8A_10m_mosaik>
        wurde nicht gefunden.
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/scripts/i.colors.enhance", line 103, in get_percentile_mp
    result = get_percentile(map, percentiles)
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/scripts/i.colors.enhance", line 89, in get_percentile
    percentiles = values, quiet = True)
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py", line 446, in read_command
    return handle_errors(returncode, stdout, args, kwargs)
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py", line 313, in handle_errors
    returncode=returncode)
CalledModuleError: Module run None ['r.quantile', '--q', 'input=S2A_USER_MSI_L2A_TL_SGS__20151211T193047_A002452_B8A_10m_mosaik', 'percentiles=2,98'] ended with error
Process ended with non-zero return code 1. See errors in the (error) output.
^CTraceback (most recent call last):
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/scripts/i.colors.enhance", line 226, in <module>
    Process Process-2:
Process Process-3:
main()
Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/scripts/i.colors.enhance", line 165, in main
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    (v0, v1) = input_pipe.recv()
KeyboardInterrupt
    self.run()
    self.run()
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
    self._target(*self._args, **self._kwargs)
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/scripts/i.colors.enhance", line 103, in get_percentile_mp
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/scripts/i.colors.enhance", line 103, in get_percentile_mp
    result = get_percentile(map, percentiles)
    result = get_percentile(map, percentiles)
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/scripts/i.colors.enhance", line 89, in get_percentile
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/scripts/i.colors.enhance", line 89, in get_percentile
    percentiles = values, quiet = True)
    percentiles = values, quiet = True)
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py", line 444, in read_command
  File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py", line 444, in read_command
    stdout, unused = process.communicate()
    stdout, unused = process.communicate()
  File "/usr/lib64/python2.7/subprocess.py", line 791, in communicate
  File "/usr/lib64/python2.7/subprocess.py", line 791, in communicate
    stdout = _eintr_retry_call(self.stdout.read)
    stdout = _eintr_retry_call(self.stdout.read)
  File "/usr/lib64/python2.7/subprocess.py", line 476, in _eintr_retry_call
    return func(*args)
  File "/usr/lib64/python2.7/subprocess.py", line 476, in _eintr_retry_call
KeyboardInterrupt
    return func(*args)
KeyboardInterrupt

To replicate:

i.colors.enhance b=bla g=blu r=blo
...

Perhaps an is-input-existing-or-not test should (also) be added to the respective lib/python/ library?

Change History (8)

comment:1 Changed 4 years ago by martinl

Milestone: 7.0.47.0.5

comment:2 Changed 3 years ago by neteler

Milestone: 7.0.57.0.6

comment:3 Changed 21 months ago by neteler

Milestone: 7.0.67.0.7

comment:4 Changed 14 months ago by lucadelu

In 73423:

i.colors.enhance: check for not existing maps, see #2984

comment:5 Changed 14 months ago by lucadelu

In 73424:

i.colors.enhance: check for not existing maps, see #2984

comment:6 Changed 14 months ago by lucadelu

In 73425:

i.colors.enhance: check for not existing maps, see #2984

comment:7 Changed 14 months ago by lucadelu

In 73426:

i.colors.enhance: check for not existing maps, see #2984

comment:8 Changed 14 months ago by lucadelu

Milestone: 7.0.77.2.4
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.