0

I have been trying to execute a number of processes (for example 'watershed basins' or 'channel network' - as per this tutorial - https://docs.qgis.org/3.22/en/docs/training_manual/processing/hydro.html?highlight=hydrological - using a DEM which you can access here: https://drive.google.com/file/d/1jNUrHuMYh8BbSOb6eOSuvVxDRQiyEdCQ/view?usp=sharing)

I often receive the error:

The following layers were not correctly generated.

On some occasions, with some processes, it will produce the layers and give the error, and with other processes it won't produce anything - just leaving me with the error.

The process appears to run OK until the end when it says:

Loading resulting layers

The following layers were not correctly generated.

/private/var/folders/1z/ct6tv26d6g74hcqcg25wk14m0000gn/T/processing_oNVWGm/4fa5dfa139c148b1917b210ad3bab266/BASINS.sdat

You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

This first happened when I was using SAGA tools in version 3.16, then I upgraded to version 3.22.3 (having read that there were new SAGA tools as plugins, and thinking this change might help), but I am experiencing the same issue (even if I have now eliminated the yellow warning about compatibility that used to annoy me).

Can anyone suggest something to fix this or offer insight into what is causing an issue?

For context, I have virtually never been able to use GRASS or SAGA tools in QGIS without some issue like this, but nobody seems to ever have any helpful insight as to what might even be going wrong.


I have now reverted to v3.16 and - to help give a more precise example of one case where this happens (though I get this fairly often), I will outline what I was doing, stepping through the tutorial mentioned above, this is what happens:

  1. Catchment Area - completes (with errors) but creates three raster layers. Errors read as: "Loading resulting layers The following layers were not correctly generated. •/private/var/folders/1z/ct6tv26d6g74hcqcg25wk14m0000gn/T/processing_vlMXXm/4508dbbc6002431f8958336d1a566222/ACCU_RIGHT.sdat •/private/var/folders/1z/ct6tv26d6g74hcqcg25wk14m0000gn/T/processing_vlMXXm/5d575b49da8a478cbfa7dd9764a75618/ACCU_TOTAL.sdat •/private/var/folders/1z/ct6tv26d6g74hcqcg25wk14m0000gn/T/processing_vlMXXm/bb7d894ec2f446c2af331a231fd17c06/VAL_MEAN.sdat •/private/var/folders/1z/ct6tv26d6g74hcqcg25wk14m0000gn/T/processing_vlMXXm/f42e3a49c6a243ab8afc5299bd20498d/ACCU_LEFT.sdat"

  2. At the next step - running the Channel Network process (as described in the walkthrough), it fails and generates no new layer(s). Error messages are: "The following layers were not correctly generated. •/private/var/folders/1z/ct6tv26d6g74hcqcg25wk14m0000gn/T/processing_vlMXXm/29e7c4729769418db25af2d93065c72b/SHAPES.shp •/private/var/folders/1z/ct6tv26d6g74hcqcg25wk14m0000gn/T/processing_vlMXXm/385031af01d741c79771cb18ab5210f5/CHNLNTWRK.sdat •/private/var/folders/1z/ct6tv26d6g74hcqcg25wk14m0000gn/T/processing_vlMXXm/6464b7f9bde340e69a46ae52a24b7430/CHNLROUTE.sdat"

This was where I cannot continue (in both versions of QGIS).

9
  • 2
    That is a generic error that tells only that something failed. Could you present a reproducible test case with test data and description about what to do for making the error to appear?
    – user30184
    Jan 21 at 7:11
  • I can explain what I did (as above) but not guarantee that it's reproducible. The issues I have seem to always mention that path /private/var/folders etc.. but I no such directory exists on my computer. Is there some issue there perhaps? Jan 24 at 0:52
  • I have been trying to execute a number of commands is not exact enough. The error means that the result would have been written to a file at the given location but something, at some stage failed.
    – user30184
    Jan 24 at 6:43
  • 1
    Here's a couple of suggestions I've used when I don't get a result. First, I always run the Check Geometry tool, and typically the v.clean. Then I try the SAGA tool. Second, I try running the tool in SAGA's GUI and see if it works there. It's GUI isn't as easy to use but if it works then I skip the test and just use it.
    – johns
    Jan 24 at 21:52
  • 1
    More detail, links etc added above in original post to help troubleshoot. Jan 25 at 23:19

1 Answer 1

0

The tools mentioned, "Watershed basins" and "Channel network" from SAGA, have at least two input rasters each, and you are providing solely the DEM used, which unfortunately does not allow a direct testing.

However, I believe I have an idea of what can be happening. Possibly, the input rasters are not on the exact same grid.

If this is adequate for the application intended, it is possible to resample one of the rasters based on the extent and pixel size of the other one, using the tool "Warp (Reproject)".

Some time ago, I wrote a blog post that explores this error with more detail.

5
  • I believe I am following the instructions in the QGIS manual, which only specifies one input raster (DEM). It's possible I am missing something, but if so, it is unclear what exactly. Jan 27 at 20:09
  • I have found this same error again using the SAGA function 'Contour lines from points'. The error message is: "The following layers were not correctly generated. •/private/var/folders/1z/ct6tv26d6g74hcqcg25wk14m0000gn/T/processing_uPFKNb/cd6bfe66f64f46638eff57128044868f/CONTOUR.shp" Feb 24 at 1:50
  • The error message "The following layers were not correctly generated" is a general message that can be shown for multiple kinds of errors. It happens when the generated layers are loaded after the execution (or a load attempt happens). To see the error which caused the layers not to be correctly generated, generally, one needs to scroll up on the log. These two errors are likely different, therefore I suggest you open a separate question for the points error, showing the whole log. This way, more people will see your question, too. Feb 24 at 13:21
  • I will do that next time it happens.. but I am not convinced the errors are different as I am 95% unable to use any SAGA tools at all. They pretty much ALL return this error. Feb 26 at 3:53
  • @ActionEcologist this is a general problem with the SAGA GIS tools, is that right? Could you edit the original question to include the full log of the error? I also suggest checking this question, which might be similar to yours: gis.stackexchange.com/questions/307491/… Feb 27 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.