Error: "no lines available in input"

503 views
Skip to first unread message

Aashutosh Aryal

unread,
Apr 30, 2023, 9:24:46 PM4/30/23
to R-SWAT
Hi, 
I am facing the following issue while trying to run the RSWAT:
[SPS-ERROR] 2023-04-30 20:51:34 task 19 failed - "no lines available in input"

The RSWAT runs smoothly but towards the end of the simulation, this error shows up and the simulation run is interrupted. Any help to solve this issue would be great.
Thanks.

Tam Nguyen

unread,
Jun 5, 2023, 2:25:58 AM6/5/23
to R-SWAT
could you share with me your TxtInOut folder and the RSWATproject.rds file?

Zsolt Jolankai

unread,
Mar 4, 2024, 7:58:16 AM3/4/24
to R-SWAT
Dear all,

I have received the same message today after a model simulation, can you please share me, what was the solution to this problem? 

Kind regards
Zsolt

Tam Nguyen

unread,
Mar 4, 2024, 2:30:21 PM3/4/24
to R-SWAT
I checked and in the current RSWAT version, it only work when you selected "Object" and "Conditions" are "All". I need to check SWAT+ if they updated SWAT+ or there is something wrong with RSWATUnbenannt.PNG

Tam Nguyen

unread,
Mar 5, 2024, 7:58:29 AM3/5/24
to R-SWAT
I have updated RSWAT
Now you can calibrate for any "object" and "condition".
@ Zsolt 
The error " [SPS-ERROR] 2023-04-30 20:51:34 task 19 failed - "no lines available in input"
because you didn't tell SWAT+ to print out the output file (should put "y" in lines 42 of the print.prt file) and  put "calibration.cal" in lines 22 of the file file.cio instead of "null"

Zsolt Jolankai

unread,
Mar 5, 2024, 2:00:42 PM3/5/24
to Tam Nguyen, R-SWAT
Dear Tam,

thanks you very much, the simulation runs now without error.

best regards
Zsolt

--
You received this message because you are subscribed to a topic in the Google Groups "R-SWAT" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/R-SWAT/jYK9GRxGfrc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to R-SWAT+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/R-SWAT/7d0f0e7a-82d8-45a9-a869-c7388e49c797n%40googlegroups.com.

Sydney Sichilima

unread,
Mar 21, 2024, 6:39:03 AM3/21/24
to R-SWAT
Dear Jolankai,
I am kind of facing the same challenge, however, I have tried to follow instructions you were given but it's not working for me. Would you mind to assist me. Please see the attache errors I am receiving once I click run SWAT.
I have attached file.cio as well.
Regards
Sydney.

file.cio
Error_1.jpg
Error_2.jpg

Zsolt Jolankai

unread,
May 15, 2024, 3:43:12 AM5/15/24
to R-SWAT
Dear Sydney,

I think you should not put calibration.cal at each column in your change line (chg). The values you can use here are described in the manual: cal_params.cal should be the first and calibration.cal should be the second item.

With regard the message: I am experiencing the same problem again, even if my text files are correct (I believe).
Error: [SPS-ERROR] 2024-05-10 12:43:22.303578 task 1 failed - "no lines available in input"
Dera @Tam, can you please check the problem for my case? 

Best Regards
Zsolt

print.prt
file.cio

Tam Nguyen

unread,
Aug 2, 2024, 5:00:40 AM8/2/24
to R-SWAT
could you just run SWAT+ independently (click to the SWAT+ executable files in the TxtInOut folder) to see if it work

Mahesh Tapas

unread,
Sep 22, 2024, 2:12:45 PM9/22/24
to R-SWAT
Did you solve this error? I am getting the same message.

Alfa Essossinam

unread,
Nov 29, 2024, 8:58:58 AM11/29/24
to R-SWAT
I think the problem is from the range that has been set for each parameter at Step2. 
When using parallel processing, you would notice some core(s) run till the end but others do not. Those that stop are those where at least one parameter value sampled is out of bound. To solve the problem, open your wolkingFolder/output then "CurrentSimulationReport.log". From there you can determine the core(s) that could not achieve it's simulation. Open the TxtInOut_x corresponding, then calibration.cal, there you will see the values sampled for each parameter. You can use your experience to determine the parameter(s) and the value(s) out of bound or start deleting parameters (the whole line) one at a time and running  the model using the executable which is already in the TxtInOut_x folder. It will keep failling until the parameter(s) out of bound is (are) removed. Once the parameter(s) out of bound is determined adjust the value until SWAT (executable) could run properly. Reajust the range then and restart the process at Step2. The parameter out of bound in my case was bd.sol

I hope this would help, good luck.


Essossinam


chidinma igwenagu

unread,
Feb 7, 2025, 2:01:38 PM2/7/25
to R-SWAT
Dear Tam,
I have the error " task 1 failed - "no lines available in input",
I have made adjustments to my file.cio and print.prt files as suggested by comments here, but i still have the same error.
I would appreciate your help please.
Chidi

Fernando Avendaño

unread,
Apr 2, 2025, 5:34:43 AM4/2/25
to R-SWAT
Hi all,

Alfa's suggestion to identify what the problem is is very useful! First, identify the problematic core and in the TxtInOut_x folder you can run your debug executable using cmd or powershell. This will tell you which parameter is out of bund.

It is very important to have in mind that objects to apply the parameter sampling are not "name id" but the "unit id". For instance, I was using aqu100, but the unit id (which you can find in the .txt of each element as "unit" column) was 10.

I hope this helps,

Tam Nguyen

unread,
Apr 2, 2025, 5:43:24 AM4/2/25
to R-SWAT
Hi Faven,

Thank your for this remark. I think this remark should be added to the RSWAT help button (but it needs further verifcation).

could you share with me your TxtInOut and a more detail description to demonstrate your point " It is very important to have in mind that objects to apply the parameter sampling are not "name id" but the "unit id". For instance, I was using aqu100, but the unit id (which you can find in the .txt of each element as "unit" column) was 10."

This could help other when using RSWAT

Tam

Mahabub Chowdhury

unread,
Jan 12, 2026, 1:53:33 PMJan 12
to R-SWAT

Hello everyone,

I am running SWAT+ using RSWAT and encountering an error during the calibration workflow, even though the SWAT+ simulation itself runs without any problem.

Simulation status:

  • SWAT+ run completes successfully

  • Console message: “Execution successfully completed”

  • Output files (e.g., channel_sd_day.txt) are generated

  • print.prt and file.cio have been checked and look correct

Error in RSWAT:

Error in { : task 2 failed - "no lines available in input"

When it happens:

  • Task 1 (model execution) completes successfully

  • The error occurs in task 2, when RSWAT tries to read outputs / calculate the objective function

What I have already checked:

  • Output variables are enabled in print.prt

  • Simulation period and output frequency are correct in file.cio

  • SWAT+ executable runs correctly outside RSWAT

  • Output files are not empty and can be opened manually

  • I reviewed RSWAT FAQ #1 (SWAT+: constant objective function values?) and the related YouTube guidance.  Has anyone experienced this error?

Thanks

Mahabub Chowdhury

unread,
Jan 14, 2026, 11:32:11 AMJan 14
to R-SWAT
Hello everyone,

I would really appreciate it if someone could take a look at my observed data file format and let me know if it looks correct.

Thank you very much in advance for your time and help.

Best regards,
Mahabub

obs_var_1.txt

Fernando Avendaño

unread,
Jan 18, 2026, 2:42:55 PMJan 18
to R-SWAT
Hi Mahabub,

I finished running your TxtInOut. I had some trouble at first, but I realised that my RAM memory was not enough to run 4 cores at the same time for this project, as is quite large. My solution was to decrease the number of cores from 4 to 2. Have you tried this?

Regards,

Gafar Agunbiade

unread,
Jan 18, 2026, 2:42:55 PMJan 18
to Mahabub Chowdhury, R-SWAT
What errors were you getting when you used this ?

Gafar Agunbiade
Ph.D. Student in Agricultural Systems Management,
Department Of Agricultural Sciences.
Clemson University.
Office/Lab: South Carolina Water Resources Center,
509 Westinghouse Road, Pendleton, SC, 29670.

From: r-s...@googlegroups.com <r-s...@googlegroups.com> on behalf of Mahabub Chowdhury <mahab...@gmail.com>
Sent: Tuesday, January 13, 2026 07:08
To: R-SWAT <r-s...@googlegroups.com>
Subject: Re: Error: "no lines available in input"
 
You received this message because you are subscribed to the Google Groups "R-SWAT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to R-SWAT+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/R-SWAT/0694b5f7-819c-413f-b828-850e4c138addn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages