Opened 8 years ago

Closed 6 years 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 by martinl, 8 years ago

Milestone: 7.0.47.0.5

comment:2 by neteler, 8 years ago

Milestone: 7.0.57.0.6

comment:3 by neteler, 6 years ago

Milestone: 7.0.67.0.7

comment:4 by lucadelu, 6 years ago

In 73423:

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

comment:5 by lucadelu, 6 years ago

In 73424:

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

comment:6 by lucadelu, 6 years ago

In 73425:

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

comment:7 by lucadelu, 6 years ago

In 73426:

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

comment:8 by lucadelu, 6 years ago

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