Bug report #19700

No output from grass toolbox function

Added by vince - over 5 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/GRASS
Affected QGIS version:3.2.2 Regression?:No
Operating System:MacOS X Easy fix?:No
Pull Request or Patch supplied:No Resolution:no timely feedback
Crashes QGIS or corrupts data:No Copied to github as #:27525

Description

When I execute a Grass function with the Toolbox, nothing happens. The result layer is not generated which cases an error in the last v.ogr.out command, but no intermediate error is reported.

Processing algorithm…
Algorithm 'v.extrude' starting…
Input parameters:
{ '-t' : False, 'GRASS_MIN_AREA_PARAMETER' : 0.0001, 'GRASS_OUTPUT_TYPE_PARAMETER' : 0, 'GRASS_REGION_CELLSIZE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'GRASS_SNAP_TOLERANCE_PARAMETER' : -1, 'GRASS_VECTOR_DSCO' : '', 'GRASS_VECTOR_LCO' : '', 'elevation' : None, 'height' : 10, 'height_column' : None, 'input' : 'dbname=\'Lyon\' host=localhost port=5432 sslmode=disable key=\'gid\' srid=2154 type=MultiPolygonZ table=\"public\".\"bati\" (geom) sql=', 'method' : 0, 'null_value' : None, 'output' : '/var/folders/67/_hxgsxvd5jncf0y_j6hct0gc0000gn/T/processing_bbc839ec353547299907f2d5528eb35e/8aecbbc94b8144ceb5107c1c64950555/output.shp', 'scale' : 1, 'type' : [0,1,2], 'where' : '', 'zshift' : 0 }

g.proj -c proj4="+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" 
v.external input="/var/folders/67/_hxgsxvd5jncf0y_j6hct0gc0000gn/T/processing_bbc839ec353547299907f2d5528eb35e/5870cefdeb8e4357b24773a81ec3dd07/input.shp" output="vector_5b82c4a3099f23" --overwrite -o
g.region n=6524784.904786891 s=6513961.704437176 e=847593.8996833172 w=837752.8998626857 res=100.0
v.extrude input=vector_5b82c4a3099f23 type="point,line,area" zshift=0 height=10 method="nearest" scale=1 output=output424ee09ae9a04d72bdcf0bc52c028fb0 --overwrite
v.out.ogr -c type="auto" input="output424ee09ae9a04d72bdcf0bc52c028fb0" output="/var/folders/67/_hxgsxvd5jncf0y_j6hct0gc0000gn/T/processing_bbc839ec353547299907f2d5528eb35e/8aecbbc94b8144ceb5107c1c64950555/output.shp" format="ESRI_Shapefile" --overwrite
Cleaning up temporary files...

Starting GRASS GIS...

__________ ___ __________ _______________

/ ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/

/ / __/ /_/ / /| | \__ \\_ \ / / __ / / \__ \

/ /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ /

\____/_/ |_/_/ |_/____/____/ \____/___//____/

Welcome to GRASS GIS 7.4.1

GRASS GIS homepage: http://grass.osgeo.org

This version running through: TC Shell (/bin/tcsh)

Help is available with the command: g.manual -i

See the licence terms with: g.version -c

See citation options with: g.version -x

Start the GUI with: g.gui wxpython

When ready to quit enter: exit

Cleaning up temporary files...

Done.

Goodbye from GRASS GIS

Cleaning up temporary files...

Starting GRASS GIS...

_________ ___ __________ _______________

/ ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/

/ / __/ /_/ / /| | \__ \\_ \ / / __ / / \__ \

/ /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ /

\____/_/ |_/_/ |_/____/____/ \____/___//____/

Welcome to GRASS GIS 7.4.1

GRASS GIS homepage: http://grass.osgeo.org

This version running through: TC Shell (/bin/tcsh)

Help is available with the command: g.manual -i

See the licence terms with: g.version -c

See citation options with: g.version -x

Start the GUI with: g.gui wxpython

When ready to quit enter: exit

Cleaning up temporary files...

Done.

Goodbye from GRASS GIS

Execution completed in 12.41 seconds
Results:
{'output': <QgsProcessingOutputLayerDefinition {'sink':/var/folders/67/_hxgsxvd5jncf0y_j6hct0gc0000gn/T/processing_bbc839ec353547299907f2d5528eb35e/8aecbbc94b8144ceb5107c1c64950555/output.shp, 'createOptions': {'fileEncoding': 'System'}}>}

Loading resulting layers
The following layers were not correctly generated.<ul><li>/var/folders/67/_hxgsxvd5jncf0y_j6hct0gc0000gn/T/processing_bbc839ec353547299907f2d5528eb35e/8aecbbc94b8144ceb5107c1c64950555/output.shp</li></ul>You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

I've taken v.extrude as an example, but I get the same behavior with v.buffer, for example. It’s like the output file somehow vanishes.

grassAlgInModeler.model3 (10.4 KB) Luigi Pirelli, 2018-09-10 05:27 PM

cascaded_grass_buffers.model3 (8.73 KB) Luigi Pirelli, 2018-09-13 04:29 PM

History

#1 Updated by vince - over 5 years ago

  • Category changed from GRASS to Processing/GRASS

#2 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback

Is this limited to v.extrude or is the same for any GRASS tool?

#3 Updated by Luigi Pirelli over 5 years ago

Giovanni Manghi wrote:

Is this limited to v.extrude or is the same for any GRASS tool?

I'm facing unreliable execution of grass algorithms. I'm using them in modeler. Sometimes they work, or if there are more than one grass command, sometimes stop in a command and some other time in another.

trying to create a model that constantly replicate the issue.
Apparently the commands are launched two times, but the second one has some "none" command. BTW find a way to replicate

Issue is faced in Linux

#4 Updated by Luigi Pirelli over 5 years ago

For example the attached model use two r.null from the same raster input.

some times the result is correct (rarely), sometimes the CCC output has Nodatavalue, sometimes both BBB and CCC are all nodatavalues.

No yet clear if the all have this issues have the same origin (IMHO yes)

#5 Updated by Giovanni Manghi over 5 years ago

Luigi Pirelli wrote:

For example the attached model use two r.null from the same raster input.

some times the result is correct (rarely), sometimes the CCC output has Nodatavalue, sometimes both BBB and CCC are all nodatavalues.

No yet clear if the all have this issues have the same origin (IMHO yes)

I'm also having some trouble on master (where LTR works well).

#6 Updated by Luigi Pirelli over 5 years ago

in my case the grass base command is (for some reason not clear to me) set to None. E.g.

Grass7Utils.command = None also if there was a previous grass command executed successfully.
I added:

if Grass7Utils.command is None:
if not Grass7Utils.grassBin():
message = "Cannot set grass executable"
QgsMessageLog.logMessage(message, 'DEBUG', Qgis.Info)
return None, None

in def prepareGrassExecution(commands) (Grass7Utils.py)

to set agaoin it's value preparing the command to execute.

#7 Updated by Luigi Pirelli over 5 years ago

I'm facing that some algorithm can't parse QgasProcessingOutputLayerDefinition and return the corresponding input rasterlayer

the attached model cascaded_grass_buffers.model3 replicate the issue and fail in this phase https://qgis.org/api/qgsprocessingparameters_8cpp_source.html#l00515

checking the reason of this

#8 Updated by Luigi Pirelli over 5 years ago

probably lack of

if ( val.canConvert&lt;QgsProcessingOutputLayerDefinition&gt;() )
{
// input is a QgsProcessingOutputLayerDefinition - get extra properties from it
QgsProcessingOutputLayerDefinition fromVar = qvariant_cast&lt;QgsProcessingOutputLayerDefinition&gt;( val );
val = fromVar.sink;
}
if ( val.canConvert&lt;QgsProperty&gt;() && val.value< QgsProperty >().propertyType() == QgsProperty::StaticProperty ) {
val = val.value< QgsProperty >().staticValue();
}

in https://qgis.org/api/qgsprocessingparameters_8cpp_source.html#l00515

#9 Updated by Nyall Dawson over 5 years ago

Is this fixed now?

#10 Updated by vince - over 5 years ago

Nyall Dawson wrote:

Is this fixed now?

Oops. I've been a bit busy lately, I didn't had time to have a look. Might be, but might not. I’ll take a gander tonight. Sorry for being so unresponsive.

#11 Updated by Jürgen Fischer over 5 years ago

  • Resolution set to no timely feedback
  • Status changed from Feedback to Closed

Also available in: Atom PDF