powered by simpleCommunicator - 2.0.41     © 2025 Programmizd 02
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Падает веб-приложение с ошибкой "Задание не найдено"
11 сообщений из 11, страница 1 из 1
Падает веб-приложение с ошибкой "Задание не найдено"
    #39973338
Vlad__i__mir
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Здравствуйте!

Стоит сервер Windows Server 2008 R2 Enterprise 64 OS 20 GB ozu. На нём веб-сервер IIS. На этом веб-сервере крутится asp.net приложение, которое выгружает из БД данные по запросу и загружает. До текущего месяца всё было нормально, но в этом месяце оно начало падать на определенном наборе данных (одном из самых больших) с ошибкой "Задание не найдено". Это сообщение валится вот из этого класса, из вот этого метода "GetTaskStatus":
Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
<%@ WebService Language="c#" Class="AccountingCardManagementService" %>
 
[WebService(Namespace = "http://integro.ru/estate/")]
public class AccountingCardManagementService : Integro.InMeta.Web.WebService
{
    public const string AccountingCardTask = "AccountingCardTasks\\AccountingCardTasks.exe";
    public const string AcceptCardParameters = "Action=accept AppId={0} UserAccount={1} ProcessId={2}";
    public const string UnloadCardParameters = "Action=unload AppId={0} UserAccount={1} ComplexId={2} OutputDir=\"{3}\"";
    public const string UnloadCardsPath = "unloadcards";
 
    public AccountingCardManagementService()
    {
        Settings.Init(Session.Application);
    }
 
    [WebMethod]
    public string AcceptCard(string processId)
    {
        if ( !Security.CanExecute(new InMetaServerSession(Session), Operations.ВнесениеКартУчетаВБД) ) {
            throw new Exception("Нет прав на внесение карт учета в БД");
        }
        string parameters = string.Format(AcceptCardParameters,
            Session.Application.Id,
            Session.UserAccount,
            processId);
 
        return TaskProcessor.Start("AcceptAccountingCard", AccountingCardTask, parameters);
    }
 
    [WebMethod]
    public void DeleteProcess(string processId)
    {
        if(!Security.CanExecute(new InMetaServerSession(Session), Operations.УдалениеПроцессовПриемки)){
            throw new Exception("Нет прав на удаление процессов приемки");
        }
        DataObject process = Session["AccountingCard/AcceptanceProcess"].QueryObject("State", new DataId(processId));
        if ( process.GetInteger("State", 0) == 2 ) {
            throw new Exception("Процесс не может быть удален, так карта уже внесена в БД");
        }
        process.Delete();
        Session.Commit();
    }
 
    [WebMethod]
    public string UnloadCard(string complexId)
    {
        if ( !Security.CanExecute(new InMetaServerSession(Session), Operations.ВыгрузкаКартУчета) ) {
            throw new Exception("Нет прав на выгрузку карт учета");
        }
 
        if (!string.IsNullOrEmpty(complexId)) {
            InMetaServerSession session = new InMetaServerSession(Session);
 
            if (Settings.Customer == Customer.МЗИО) {
                //todo: исправить получение RegisteredSubject
                RegisteredSubject registeredSubject = session.Get<RegisteredSubject>(complexId);
                if (registeredSubject.IsTreasuryPropertyExists) {
                    if (registeredSubject.IsTreasury.HasValue && registeredSubject.IsTreasury.Value) {
                        if (!Security.CanExecute(new InMetaServerSession(Session), Operations.РедактированиеОбъектовКазны)) {
                            throw new Exception("Нет прав на выгрузку карт учета казны");
                        }
                    }
                    else {
                        if (!Security.CanExecute(new InMetaServerSession(Session), Operations.РедактированиеОбъектовРеестра)) {
                            throw new Exception("Нет прав на выгрузку карт учета реестра");
                        }
                    }
                }
            }
        }       
        
        string unloadCardPath = UnloadCardsPath;        
        string parameters = string.Format(UnloadCardParameters,
            Session.Application.Id,
            Session.UserAccount,
            complexId,
            Server.MapPath(unloadCardPath));
 
        return TaskProcessor.Start("UnloadAccountingCard", AccountingCardTask, parameters);
    }
 
    [WebMethod]
    public void DeleteUnloadProcess(string processId)
    {
        if ( !Security.CanExecute(new InMetaServerSession(Session), Operations.УдалениеПроцессовВыгрузки) ) {
            throw new Exception("Нет прав на удаление процессов выгрузки");
        }
        Session["AccountingCard/UnloadProcess"][processId].Delete();
        Session.Commit();
    }
 
    [WebMethod]
    public string ReportRegisteredObjects(string RegisterNo, string Name, string HolderRegisterNo, string HolderName, string HolderInn, string Region,
        string SubRgn, string Locality, string Street, string House, string Building, string Description, string Comment) {
 
        InMetaServerSession inmetaSession = new InMetaServerSession(Session);
        Org registrHostOrg = inmetaSession.Get<Org>(Settings.RegistrHostOrgId.ToString());
        RegisteredObjectSearch search = new RegisteredObjectSearch(inmetaSession);
        search.ActualDate = DateTime.Now;
        search.RegisterNo = RegisterNo;
        search.Name = Name;
        search.HolderRegisterNo = HolderRegisterNo;
        search.HolderName = HolderName;
        search.Region = Region;
        search.SubRgn = SubRgn;
        search.Locality = Locality;
        search.Street = Street;
        search.House = House;
        search.Building = Building;
        search.Description = Description;
        search.Comment = Comment;
 
        List<RegisteredObject> registeredObjects = search.Search();
 
        ExcelTable table = new ExcelTable();
        table.Styles.Add(ExcelStyle.Header);
 
        ExcelRow header = table.Rows.Add();
        header.Style = ExcelStyle.Header;
 
        header.Cells.Add("Вид");
        header.Cells.Add("Учетный номер");
        header.Cells.Add("Наименование");
        header.Cells.Add("Адрес");
        header.Cells.Add("Балансодержатель");
        header.Cells.Add("Реестровый номер балансодержателя");
        header.Cells.Add("Площадь");
        header.Cells.Add("Этажность");
        header.Cells.Add("Примечание");
        
        foreach ( RegisteredObject registeredObject in registeredObjects ) {
            ExcelRow row = table.Rows.Add();
            row.Cells.Add(registeredObject.Kind);
            row.Cells.Add(registeredObject.RegisterNo);
            row.Cells.Add(registeredObject.NameView);
            row.Cells.Add(registeredObject.Address);
            Law mainLaw = registeredObject.GetMainLaw(registrHostOrg, DateTime.Now, Settings.LawKindIds.PropertyLawKinds);
            RegisteredSubject balanceHolder = registeredObject.GetFirstBalanceHolder(mainLaw, DateTime.Now, Settings.LawKindIds.BalanceLawKinds);
            
            row.Cells.Add(InMetaObjectUtils.Assigned(balanceHolder)? balanceHolder.Name: "Казна");
            row.Cells.Add(InMetaObjectUtils.Assigned(balanceHolder) ? balanceHolder.RegisterNo : "Казна");
            row.Cells.Add(registeredObject.Area);
            row.Cells.Add(registeredObject.FloorCount);
            row.Cells.Add(registeredObject.Comment);
        }
 
        return table.ToXml();
    }
    
    private XmlDocument GenerateError(string errorMessage, string errorDetails)
    {
            XmlDocument doc = XmlUtils.CreateDocument("task");
            XmlElement taskElem = doc.DocumentElement;
            XmlUtils.SetChildText(taskElem, "state", "error");
            XmlUtils.SetChildText(taskElem, "errorMessage", errorMessage);
            XmlUtils.SetChildText(taskElem, "errorDetails", errorDetails);          
            return doc;
    }
 
    private XmlDocument GenerateProgress(string message, int progressCount, int progressPosition)
    {
            XmlDocument doc = XmlUtils.CreateDocument("task");
            XmlElement taskElem = doc.DocumentElement;
            XmlUtils.SetChildText(taskElem, "state", "running");
            XmlUtils.SetChildText(taskElem, "message", message);
            XmlUtils.SetChildText(taskElem, "progressCount", progressCount.ToString());
            XmlUtils.SetChildText(taskElem, "progressPosition", progressPosition.ToString());           
            return doc;
    }
 
    private XmlDocument GenerateComplete(string message)
    {
            XmlDocument doc = XmlUtils.CreateDocument("task");
            XmlElement taskElem = doc.DocumentElement;
            XmlUtils.SetChildText(taskElem, "state", "complete");
            XmlUtils.SetChildText(taskElem, "message", message);            
            return doc;      
    }
 
    [WebMethod]
    public XmlDocument GetTaskStatus(string taskId)
    {
        Task task = TaskProcessor.Find(taskId);
 
        if ( task == null ) {
            return GenerateError("Задание не найдено. taskId:"+taskId, null); //ЗДЕСЬ ОШИБКА В ДАННОМ КЛАССЕ
        }
 
        switch ( task.State ) {
            case TaskState.Running:
                string message = string.Empty;
                int progressCount = 0, progressPosition = 0;
                foreach ( TaskExecution execution in task.Executions ) {
                    message += "\r\n" + execution.Message;
                    progressCount = execution.ProgressCount;
                    progressPosition = execution.ProgressPosition;
                }
                return GenerateProgress(message, progressCount, progressPosition);
            case TaskState.Complete:
                TaskProcessor.Cancel(taskId);
                return GenerateComplete("Завершено");
            case TaskState.Error:
                TaskProcessor.Cancel(taskId);
                if ( task.Error is AccountingCardClasses.ApplicationException ) {
                    return GenerateError(task.Error.Message, null);
                }
                return GenerateError(task.Error.Message, task.Error.ToString());
            default:
                return GenerateError("Неизвестное состояние задания", null);
        }
    }
}



Прога написана лет 10 назад, исходников нет. taskId из метода GetTaskStatus - это 4-х значный номер, который при каждом запуске увеличивается на единицу.

Отдельно получилось декомпилить библиотеку с классом и методом TaskProcessor.Find(taskId), в котором возникает ошибка:
Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
using Integro.InMeta.Runtime;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Xml;
 
namespace TaskProcesses
{
  public class TaskProcessor : IDisposable
  {
    private FileStream m_indexFile;
    public readonly XmlDocument Document;
    private static string communicationFolder;
 
    public XmlElement Root
    {
      get
      {
        return this.Document.DocumentElement;
      }
    }
 
    private static string CommunicationFolder
    {
      get
      {
        if (TaskProcessor.communicationFolder == null)
          TaskProcessor.communicationFolder = Path.Combine(DataApplication.get_InMetaInstallPath(), "Tasks");
        return TaskProcessor.communicationFolder;
      }
    }
 
    private TaskProcessor(FileStream indexFile, XmlDocument document)
    {
      this.m_indexFile = indexFile;
      this.Document = document;
    }
 
    public void Dispose()
    {
      this.Close();
    }
 
    private void Close()
    {
      if (this.m_indexFile == null)
        return;
      this.m_indexFile.SetLength(0L);
      this.Document.Save((Stream) this.m_indexFile);
      this.m_indexFile.Close();
      this.m_indexFile = (FileStream) null;
    }
 
    private string GenerateNewTaskId()
    {
      string attribute = this.Root.GetAttribute("nextId");
      int num = string.IsNullOrEmpty(attribute) ? 1 : int.Parse(attribute);
      this.Root.SetAttribute("nextId", (num + 1).ToString());
      return num.ToString();
    }
 
    private string AddNewTask(string taskName)
    {
      string newTaskId = this.GenerateNewTaskId();
      XmlElement element = this.Document.CreateElement("task");
      this.SaveTask(element, new Task(taskName, newTaskId, TaskState.Running, DateTime.Now, new TaskExecution[0], (Exception) null));
      this.Root.AppendChild((XmlNode) element);
      return newTaskId;
    }
 
    private void SaveTask(XmlElement taskElement, Task task)
    {
      if (!string.IsNullOrEmpty(task.Name))
        taskElement.SetAttribute("name", task.Name);
      taskElement.SetAttribute("id", task.Id);
      taskElement.SetAttribute("state", task.State.ToString());
      taskElement.SetAttribute("lastUpdateTime", XmlConvert.ToString(task.LastUpdateTime, XmlDateTimeSerializationMode.Local));
      foreach (XmlElement selectNode in taskElement.SelectNodes("execution"))
        taskElement.RemoveChild((XmlNode) selectNode);
      foreach (TaskExecution execution in task.Executions)
      {
        XmlElement element = taskElement.OwnerDocument.CreateElement("execution");
        TaskProcessor.SaveExecution(element, execution);
        taskElement.AppendChild((XmlNode) element);
      }
      foreach (XmlElement selectNode in taskElement.SelectNodes("error"))
        taskElement.RemoveChild((XmlNode) selectNode);
      if (task.Error == null)
        return;
      XmlElement element1 = taskElement.OwnerDocument.CreateElement("error");
      this.SaveError(element1, task.Error);
      taskElement.AppendChild((XmlNode) element1);
    }
 
    private void SaveError(XmlElement element, Exception error)
    {
      XmlElement element1 = element.OwnerDocument.CreateElement("message");
      element1.InnerText = error.Message;
      element.AppendChild((XmlNode) element1);
      XmlElement element2 = element.OwnerDocument.CreateElement("details");
      element2.InnerText = error.ToString();
      element.AppendChild((XmlNode) element2);
      string str = (string) null;
      try
      {
        str = Utils.Serialize((object) error);
      }
      catch (Exception ex)
      {
        XmlElement element3 = element.OwnerDocument.CreateElement("serializationError");
        element3.InnerText = ex.ToString();
        element.AppendChild((XmlNode) element3);
      }
      if (string.IsNullOrEmpty(str))
        return;
      XmlElement element4 = element.OwnerDocument.CreateElement("data");
      element4.InnerText = str;
      element.AppendChild((XmlNode) element4);
    }
 
    private static void SaveExecution(XmlElement element, TaskExecution execution)
    {
      element.SetAttribute("message", execution.Message);
      element.SetAttribute("progressCount", execution.ProgressCount.ToString());
      element.SetAttribute("progressPosition", execution.ProgressPosition.ToString());
    }
 
    public void RemoveTask(string taskId)
    {
      XmlNode oldChild = this.Root.SelectSingleNode("task[@id='" + taskId + "']");
      if (oldChild == null)
        return;
      this.Root.RemoveChild(oldChild);
    }
 
    public static bool UpdateTask(Task task)
    {
      using (TaskProcessor taskProcessor = TaskProcessor.Open())
      {
        XmlElement taskElement = (XmlElement) taskProcessor.Root.SelectSingleNode("task[@id='" + task.Id + "']");
        if (taskElement == null)
          return false;
        taskProcessor.SaveTask(taskElement, task);
        return true;
      }
    }
 
    private static TaskProcessor Open()
    {
      string path = Path.Combine(TaskProcessor.CommunicationFolder, "tasks.xml");
      DateTime dateTime = DateTime.Now + TimeSpan.FromSeconds(1.0);
      FileStream indexFile = (FileStream) null;
      do
      {
        try
        {
          indexFile = File.Open(path, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
        }
        catch
        {
          if (DateTime.Now > dateTime)
            throw;
          else
            Thread.Sleep(1);
        }
      }
      while (indexFile == null);
      try
      {
        XmlDocument document = new XmlDocument();
        if (indexFile.Length == 0L)
        {
          document.AppendChild((XmlNode) document.CreateElement("tasks"));
        }
        else
        {
          document.Load((Stream) indexFile);
          foreach (XmlElement selectNode in document.DocumentElement.SelectNodes("task"))
          {
            if (DateTime.Now - XmlConvert.ToDateTime(selectNode.GetAttribute("lastUpdateTime"), XmlDateTimeSerializationMode.Local) > TimeSpan.FromDays(1.0))
              document.DocumentElement.RemoveChild((XmlNode) selectNode);
          }
        }
        return new TaskProcessor(indexFile, document);
      }
      catch
      {
        indexFile.Close();
        throw;
      }
    }
 
    public static Task[] GetAll()
    {
      List<Task> taskList = new List<Task>();
      using (TaskProcessor taskProcessor = TaskProcessor.Open())
      {
        foreach (XmlElement selectNode in taskProcessor.Root.SelectNodes("task"))
          taskList.Add(TaskProcessor.LoadTask(selectNode));
      }
      return taskList.ToArray();
    }
 
    private static Task LoadTask(XmlElement element)
    {
      List<TaskExecution> taskExecutionList = new List<TaskExecution>();
      foreach (XmlElement selectNode in element.SelectNodes("execution"))
        taskExecutionList.Add(TaskProcessor.LoadExecution(selectNode));
      TaskState state = (TaskState) Enum.Parse(typeof (TaskState), element.GetAttribute("state"), true);
      string attribute1 = element.GetAttribute("name");
      string attribute2 = element.GetAttribute("id");
      DateTime dateTime = XmlConvert.ToDateTime(element.GetAttribute("lastUpdateTime"), XmlDateTimeSerializationMode.Local);
      XmlElement errorElement = (XmlElement) element.SelectSingleNode("error");
      Exception error = (Exception) null;
      if (errorElement != null)
        error = TaskProcessor.LoadError(errorElement);
      return new Task(attribute1, attribute2, state, dateTime, taskExecutionList.ToArray(), error);
    }
 
    private static Exception LoadError(XmlElement errorElement)
    {
      XmlNode xmlNode = errorElement.SelectSingleNode("data");
      if (xmlNode != null)
      {
        try
        {
          return (Exception) Utils.Deserialize(xmlNode.InnerText);
        }
        catch
        {
        }
      }
      return (Exception) new TaskException(errorElement.SelectSingleNode("message").InnerText, errorElement.SelectSingleNode("details").InnerText);
    }
 
    private static TaskExecution LoadExecution(XmlElement element)
    {
      return new TaskExecution(element.GetAttribute("message"), XmlConvert.ToInt32(element.GetAttribute("progressCount")), XmlConvert.ToInt32(element.GetAttribute("progressPosition")));
    }
 
    public static string Start(string taskName, string filename, string parameters)
    {
      string str;
      using (TaskProcessor taskProcessor = TaskProcessor.Open())
        str = taskProcessor.AddNewTask(taskName);
      Process.Start(Path.Combine(Path.Combine(TaskProcessor.CommunicationFolder, "Bin"), filename), parameters + " TaskId=" + str);
      return str;
    }
 
    public static string StartAndWait(string taskName, string filename, string parameters)
    {
      string str;
      using (TaskProcessor taskProcessor = TaskProcessor.Open())
        str = taskProcessor.AddNewTask(taskName);
      Process.Start(Path.Combine(Path.Combine(TaskProcessor.CommunicationFolder, "Bin"), filename), parameters + " TaskId=" + str).WaitForExit();
      return str;
    }
 
    public static string Start(string filename, string parameters)
    {
      return TaskProcessor.Start((string) null, filename, parameters);
    }
 
    public static void Cancel(string taskId)
    {
      using (TaskProcessor taskProcessor = TaskProcessor.Open())
        taskProcessor.RemoveTask(taskId);
    }
 
    public static Task Find(string taskId)
    {
      foreach (Task task in TaskProcessor.GetAll())
      {
        if (task.Id == taskId)
          return task;
      }
      return (Task) null;
    }
 
    public static Task[] FindRunning(string taskName)
    {
      List<Task> taskList = new List<Task>();
      foreach (Task task in TaskProcessor.GetAll())
      {
        if (task.Name == taskName && task.State == TaskState.Running)
          taskList.Add(task);
      }
      return taskList.ToArray();
    }
  }
}



Из него удалось вычислить xml-файл, из которого берется данный task - "tasks.xml", который содержит следующие записи:
Код: xml
1.
2.
<?xml version="1.0"?>
<tasks nextId="8933"> </tasks>


А на дублере сервера с таким же приложением, данный файл выглядит по другому, но ошибка та же:
Код: xml
1.
2.
3.
<?xml version="1.0"?>
-<tasks nextId="7067"> <task lastUpdateTime="2020-06-23T13:39:13.2036224+05:00" state="Running" id="7064" name="UnloadAccountingCard"/>
<task lastUpdateTime="2020-06-23T13:40:36.5338309+05:00" state="Running" id="7065" name="UnloadAccountingCard"/> </tasks>



После того как удалил этот xml-файл и запустил сервис, он мне сознал новый файл следующего содержания:
Код: xml
1.
2.
<?xml version="1.0"?>
<tasks nextId="2"> </tasks>


но в процессе выполнения там была ещё 1-а стр по типу "<task lastUpdateTime="2020-06-23T13:40:36.5338309+05:00" state="Running" id="7065" name="Формирование файла"/> </tasks>", которая удалилась.

Не понимаю, что этот task означает и что с ним может быть не так?
...
Рейтинг: 0 / 0
Падает веб-приложение с ошибкой "Задание не найдено"
    #39973379
felix_ff
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Vlad__i__mir,

У Вас програмулина ищет в файле tasks.xml узлы
<task lastUpdateTime="YYYY-MM-DDTHH:MM:SS" state="<STATE_ENUM>" id="<id>" name="taskName"/>

Класс TaskProcessor оперирует файлом tasks.xml структура которого является что-то вида

Код: xml
1.
2.
3.
4.
5.
<tasks nextId="следующий доступный идентификатор задачи">
  <task lastUpdateTime="YYYY-MM-DDTHH:MM:SS" state="<состояние задачи>" id="<ид задачи>" name="<имя задачи>"/>
  <task lastUpdateTime="YYYY-MM-DDTHH:MM:SS" state="<состояние задачи>" id="<id задачи>" name="<имя задачи>"/>
...
</tasks>



Ваше asp.net приложение запускает задачи вызовами метода TaskProcessor.Start
Задача представляет из себя вызов внешнего приложения находящегося в подкаталоге Bin вашего приложения в вашем случае это что то типа C:\Program Files (x86)\Integro\InMeta\InMetaApps\Bin\AccountingCardTasks\AccountingCardTasks.exe с некоторыми параметрами.

К примеру если в ваш веб-сервис поступит вызов на AcceptCard, то в файлик tasks.xml будет добавлена строка
Код: xml
1.
<task lastUpdateTime="текущая дата" id="новый ид который ранее был в атрибуте nextId корневого узла" state="running" name="AcceptAccountingCard"/>



Далее уже вы сможете вызывать метод который будет запрашивать статус выполняемой задачи по его присвоенному идентификатору.

Ваша проблема в том что вы вызываете метод запроса статуса когда эта задача уже по факту перестала работать.
Удаляются задачи из файла только в том случае если внешнее приложение изменит их статус на "error" или "complete"
ИЛИ еще задачи удаляются если они протухли по дате

когда идет обращение метода TaskProcessor.Open и файл существует он выпадает в ветку кода которая ищет записи <task/> и если их время жизни более одного дня, то такая задача считается протухшей и она удаляется из файла.
Код: sql
1.
2.
3.
4.
5.
6.
  document.Load((Stream) indexFile);
          foreach (XmlElement selectNode in document.DocumentElement.SelectNodes("task"))
          {
            if (DateTime.Now - XmlConvert.ToDateTime(selectNode.GetAttribute("lastUpdateTime"), XmlDateTimeSerializationMode.Local) > TimeSpan.FromDays(1.0))
              document.DocumentElement.RemoveChild((XmlNode) selectNode);
          }
...
Рейтинг: 0 / 0
Падает веб-приложение с ошибкой "Задание не найдено"
    #39973408
Vlad__i__mir
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
felix_ff, большое вам спасибо! Сейчас стало понятно.
А если я запускаю программу и она думает конечно долго - минут 5, но точно не день и больше, то по идее она еще не должна становится "протухшей", а из-за чего тогда он не может её найти?
На остальных наборах данных, но они поменьше всё работает
...
Рейтинг: 0 / 0
Падает веб-приложение с ошибкой "Задание не найдено"
    #39973410
Vlad__i__mir
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
felix_ff,вот на этой задачи он сыпется, она последней появляется в tasks.xml перед сбоем:
Код: xml
1.
2.
3.
<?xml version="1.0"?>
-<tasks nextId="4">
 -<task lastUpdateTime="2020-06-26T09:20:56.403919+05:00" state="Running" id="3" name="UnloadAccountingCard"> <execution progressPosition="0" progressCount="0" message="Формирование файла данных"/> </task> </tasks>
...
Рейтинг: 0 / 0
Падает веб-приложение с ошибкой "Задание не найдено"
    #39973413
Vlad__i__mir
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Vlad__i__mir
felix_ff,вот на этой задачи он сыпется, она последней появляется в tasks.xml перед сбоем:
Код: xml
1.
2.
3.
<?xml version="1.0"?>
-<tasks nextId="4">
 -<task lastUpdateTime="2020-06-26T09:20:56.403919+05:00" state="Running" id="3" name="UnloadAccountingCard"> <execution progressPosition="0" progressCount="0" message="Формирование файла данных"/> </task> </tasks>



Нашел и декомпилил класс UnloadAccountingCard. Процесс идет до строки
Код: c#
1.
execution.SetStatus("Сбор информации из базы");

, а дальше выбрасывается исключение, что задача не найдена. При чем судя по всему не одно из исключений данного класса не срабатывает:

Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
public class UnloadAccountingCard
  {
    private readonly InMetaServerSession _session;

    public UnloadAccountingCard(InMetaServerSession session)
    {
      this._session = session;
    }

    private void CheckUnloadAvailable(RegisteredSubject registeredSubject)
    {
      if (registeredSubject == null)
        throw new Exception("Не найден субъект");
      if (registeredSubject.RegisterNo == null || registeredSubject.RegisterNo.Trim() == "")
        throw new AccountingCardClasses.ApplicationException("Выгрузка данных этого субъекта не возможна, т.к. ему не присвоен реестровый номер.");
      using (IEnumerator<AcceptanceProcess> enumerator = this._session.Query<AcceptanceProcess>("(RegisterNo = ?) and (State <> 2)", (object) registeredSubject.RegisterNo).GetEnumerator())
      {
        if (enumerator.MoveNext())
        {
          AcceptanceProcess current = enumerator.Current;
          throw new AccountingCardClasses.ApplicationException("Выгрузка данных этого субъекта не возможна, т.к. есть незавершенный процесс приема карты учета от субъекта. Обратитесь к администратору.");
        }
      }
    }

    public byte[] CreateUnloadData(
      TaskExecution execution,
      string subjectClassName,
      string subjectId)
    {
      if (!Security.CanExecute(this._session, nameof (UnloadAccountingCard)))
        throw Security.CreateAccessException();
      this._session.DataSession.TreatNullsAsZero = true;
      XmlDocument xmlDocument1 = new XmlDocument();
      xmlDocument1.LoadXml(AccountingCardUnloadXml.LoadPlan);
      execution.SetStatus("Сбор информации из базы");
      RegisteredSubject registeredSubject1 = (RegisteredSubject) null;
      if (subjectClassName == "Subject/Org")
      {
        foreach (RegisteredSubject registeredSubject2 in this._session.Query<Org>(new InMetaLoadPlan(xmlDocument1.DocumentElement.InnerXml), "id = ?", (object) subjectId))
          registeredSubject1 = registeredSubject2;
      }
      else
      {
        if (!(subjectClassName == "Subject/Person"))
          throw new Exception(string.Format("Не известный класс субъекта {0}", (object) subjectClassName));
        foreach (RegisteredSubject registeredSubject2 in this._session.Query<Org>(new InMetaLoadPlan(xmlDocument1.DocumentElement.InnerXml), "id = ?", (object) subjectId))
          registeredSubject1 = registeredSubject2;
      }
      if (registeredSubject1 == null)
        throw new Exception(string.Format("Не найден объект {0}[{1}]", (object) subjectClassName, (object) subjectId));
      this.CheckUnloadAvailable(registeredSubject1);
      execution.SetStatus("Формирование файла данных");
      XmlDocument xmlDocument2 = AccountingCardUnloadXml.Make(registeredSubject1);
      XmlUtils.SetAttr((XmlNode) xmlDocument2.DocumentElement, "DataVersion", this.CreateRecordOfUnloadCard(registeredSubject1).ToString());
      XmlUtils.SetAttr((XmlNode) xmlDocument2.DocumentElement, "GUID", Guid.NewGuid().ToString());
      if (Settings.Customer == Customer.МЗИО && (registeredSubject1.IsTreasury.HasValue && registeredSubject1.IsTreasury.Value))
        XmlUtils.SetAttr((XmlNode) xmlDocument2.DocumentElement, "IsTreasury", "True");
      execution.SetStatus("Упаковка файла данных");
      byte[] numArray = SystemUtils.CompressText(xmlDocument2.OuterXml, Encoding.GetEncoding(1251));
      this._session.DataSession.Commit();
      return numArray;
    }

    private int CreateRecordOfUnloadCard(RegisteredSubject registeredSubject)
    {
      IEnumerable<UnloadProcess> unloadProcesses = this._session.Query<UnloadProcess>(new InMetaLoadPlan("<DataVersion/>"), "RegisterNo = ?", (object) registeredSubject.RegisterNo);
      IEnumerable<AcceptanceProcess> acceptanceProcesses = this._session.Query<AcceptanceProcess>(new InMetaLoadPlan("<DataVersion/>"), "RegisterNo = ?", (object) registeredSubject.RegisterNo);
      int num1 = 0;
      foreach (UnloadProcess unloadProcess in unloadProcesses)
      {
        int? dataVersion = unloadProcess.DataVersion;
        if (dataVersion.HasValue)
        {
          int num2 = num1;
          dataVersion = unloadProcess.DataVersion;
          if ((num2 >= dataVersion.GetValueOrDefault() ? 0 : (dataVersion.HasValue ? 1 : 0)) != 0)
          {
            dataVersion = unloadProcess.DataVersion;
            num1 = dataVersion.Value;
          }
        }
      }
      foreach (AcceptanceProcess acceptanceProcess in acceptanceProcesses)
      {
        int? dataVersion = acceptanceProcess.DataVersion;
        if (dataVersion.HasValue)
        {
          int num2 = num1;
          dataVersion = acceptanceProcess.DataVersion;
          if ((num2 >= dataVersion.GetValueOrDefault() ? 0 : (dataVersion.HasValue ? 1 : 0)) != 0)
          {
            dataVersion = acceptanceProcess.DataVersion;
            num1 = dataVersion.Value;
          }
        }
      }
      int num3 = num1 + 1;
      UnloadProcess unloadProcess1 = this._session.AddNew<UnloadProcess>();
      unloadProcess1.RegisterNo = registeredSubject.RegisterNo;
      unloadProcess1.UnloadTime = new DateTime?(DateTime.Now);
      unloadProcess1.UnloadingUserAccount = this._session.DataSession.UserAccount;
      unloadProcess1.DataVersion = new int?(num3);
      return num3;
    }

    private static string RefBooksFolder
    {
      get
      {
        return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "RefBooks");
      }
    }

    private void ActualizeRefBooks(XmlDocument indexDoc)
    {
      bool flag1 = false;
      bool flag2 = false;
      foreach (XmlNode selectNode in indexDoc.DocumentElement.SelectNodes("refbook"))
      {
        string attr1 = XmlUtils.GetAttr(selectNode, "external-file");
        string attr2 = XmlUtils.GetAttr(selectNode, "class-name");
        DateTime lastUpdateTime = this.GetLastUpdateTime(attr2);
        if (!XmlUtils.ContainsAttr(selectNode, "last-update-time") || !(lastUpdateTime == XStrUtils.ToDateTime(XmlUtils.GetAttr(selectNode, "last-update-time"), DateTime.MinValue)))
        {
          if (string.IsNullOrEmpty(attr1))
            flag1 = true;
          else
            this.ActualizeRefBookExternalFile(attr2, attr1);
          XmlUtils.SetAttr(selectNode, "last-update-time", XStrUtils.ToXStr(lastUpdateTime));
          flag2 = true;
        }
      }
      if (flag1)
        this.ActualizeRefBooksXml(indexDoc);
      if (!flag2)
        return;
      indexDoc.Save(Path.Combine(UnloadAccountingCard.RefBooksFolder, "unloadRefbook.xml"));
    }

    private DateTime GetLastUpdateTime(string className)
    {
      using (InDbCommand command = this._session.DataSession.Db.CreateCommand(string.Format("select max(UpdateTime) from _UpdateLog where ClassName = '{0}'", (object) className)))
      {
        using (IDataReader dataReader = command.ExecuteReader())
        {
          if (dataReader.Read() && !dataReader.IsDBNull(0))
            return dataReader.GetDateTime(0);
        }
      }
      return DateTime.MinValue;
    }

    private static void AddDataPropertyToXml(
      MetadataProperty metaProperty,
      XmlNode classNode,
      object propertyValue)
    {
      if (propertyValue == DBNull.Value)
        return;
      XmlUtils.AppendElement(classNode, metaProperty.Name, XStrUtils.ToXStr(propertyValue));
    }

    private static void AddAssociationPropertyToXml(
      MetadataProperty metaProperty,
      XmlNode classNode,
      object propertyValue,
      object selectorPropertyValue)
    {
      if (propertyValue == DBNull.Value)
        return;
      MetadataAssociationRef metadataAssociationRef = selectorPropertyValue == null ? metaProperty.Association.Refs[0] : metaProperty.Association.Refs.FindBySelectorValue(selectorPropertyValue);
      if (metadataAssociationRef == null)
        throw new Exception(string.Format("У класса {0}, для свойства {1} не найдена ссылка на класс. [{2}]", (object) metaProperty.Class.Name, (object) metaProperty.Name, (object) XmlUtils.GetAttr(classNode, "OID")));
      XmlUtils.SetAttr((XmlNode) XmlUtils.AppendElement(classNode, metaProperty.Name, XStrUtils.ToXStr(propertyValue)), "RefClass", metadataAssociationRef.RefClass.Name);
    }

    private void AddClassDataToXml(MetadataClass metaClass, XmlNode node)
    {
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.AppendFormat("[{0}]", (object) metaClass.IDProperty.DataField);
      for (int index = 0; index < metaClass.Properties.Count; ++index)
      {
        MetadataProperty property = metaClass.Properties[index];
        if (!property.IsId)
        {
          if (property.IsData)
            stringBuilder.AppendFormat(",[{0}]", (object) property.DataField);
          else if (property.IsAssociation || property.IsAggregation)
          {
            stringBuilder.AppendFormat(",[{0}]", (object) property.DataField);
            if (property.Association.Selector != null)
              stringBuilder.AppendFormat(",[{0}]", (object) property.Association.Selector.DataField);
          }
        }
      }
      string sql = string.Format("select {0} from [{1}]", (object) stringBuilder, (object) metaClass.DataTable);
      string name = metaClass.Name.Replace('/', '_');
      using (InDbCommand command = this._session.DataSession.Db.CreateCommand(sql))
      {
        using (IDataReader dataReader = command.ExecuteReader())
        {
          while (dataReader.Read())
          {
            XmlNode xmlNode = (XmlNode) XmlUtils.AppendElement(node, name);
            XmlUtils.SetAttr(xmlNode, "Id", dataReader.GetString(0));
            int i = 1;
            for (int index = 0; index < metaClass.Properties.Count; ++index)
            {
              MetadataProperty property = metaClass.Properties[index];
              if (!property.IsId)
              {
                if (property.IsData)
                {
                  UnloadAccountingCard.AddDataPropertyToXml(property, xmlNode, dataReader.GetValue(i));
                  ++i;
                }
                else if (property.IsAssociation || property.IsAggregation)
                {
                  if (property.Association.Selector != null)
                  {
                    UnloadAccountingCard.AddAssociationPropertyToXml(property, xmlNode, dataReader.GetValue(i), dataReader.GetValue(i + 1));
                    i += 2;
                  }
                  else
                  {
                    UnloadAccountingCard.AddAssociationPropertyToXml(property, xmlNode, dataReader.GetValue(i), (object) null);
                    ++i;
                  }
                }
              }
            }
          }
        }
      }
    }

    private void ActualizeRefBooksXml(XmlDocument indexDoc)
    {
      List<MetadataClass> metadataClassList = new List<MetadataClass>();
      foreach (XmlNode selectNode in indexDoc.DocumentElement.SelectNodes("refbook"))
      {
        if (string.IsNullOrEmpty(XmlUtils.GetAttr(selectNode, "external-file")))
          metadataClassList.Add(this._session.DataSession.Application.Metadata.Classes.Need(XmlUtils.GetAttr(selectNode, "class-name")));
      }
      XmlDocument xmlDocument = new XmlDocument();
      xmlDocument.LoadXml("<?xml version=\"1.0\" encoding=\"windows-1251\"?><data></data>");
      foreach (MetadataClass metaClass in metadataClassList)
        this.AddClassDataToXml(metaClass, (XmlNode) xmlDocument.DocumentElement);
      string outFilename = Path.Combine(UnloadAccountingCard.RefBooksFolder, "refbooks.xml");
      SystemUtils.CompressText(xmlDocument.OuterXml, outFilename, Encoding.GetEncoding(1251));
    }

    private static string EncloseCsvValue(string value)
    {
      bool flag = false;
      for (int index = 0; index < value.Length; ++index)
      {
        char c = value[index];
        if (!char.IsLetterOrDigit(c) && c != '_')
        {
          flag = true;
          break;
        }
      }
      return !flag ? value : "\"" + value.Replace("\"", "\"\"") + "\"";
    }

    private void ActualizeRefBookExternalFile(string className, string fileName)
    {
      string sql = string.Format("select * from [{0}]", (object) this._session.DataSession.Application.Metadata.Classes.Need(className).DataTable);
      StringBuilder stringBuilder = new StringBuilder();
      using (InDbCommand command = this._session.DataSession.Db.CreateCommand(sql))
      {
        using (IDataReader dataReader = command.ExecuteReader())
        {
          for (int i = 0; i < dataReader.FieldCount; ++i)
          {
            if (i > 0)
              stringBuilder.Append(",");
            stringBuilder.Append(UnloadAccountingCard.EncloseCsvValue(dataReader.GetName(i)));
          }
          stringBuilder.AppendLine();
          while (dataReader.Read())
          {
            for (int i = 0; i < dataReader.FieldCount; ++i)
            {
              if (i > 0)
                stringBuilder.Append(",");
              stringBuilder.Append(UnloadAccountingCard.EncloseCsvValue(XStrUtils.ToXStr(dataReader.GetValue(i))));
            }
            stringBuilder.AppendLine();
          }
        }
      }
      string outFilename = Path.Combine(UnloadAccountingCard.RefBooksFolder, fileName);
      SystemUtils.CompressText(stringBuilder.ToString(), outFilename, Encoding.GetEncoding(1251));
    }

    public string[] GetRefBookFileNames()
    {
      XmlDocument indexDoc = XmlUtils.LoadDocument(Path.Combine(UnloadAccountingCard.RefBooksFolder, "unloadRefbook.xml"));
      this.ActualizeRefBooks(indexDoc);
      XmlNodeList xmlNodeList = indexDoc.DocumentElement.SelectNodes("refbook/@external-file");
      string[] strArray1 = new string[xmlNodeList.Count + 1];
      int num1 = 0;
      string[] strArray2 = strArray1;
      int index = num1;
      int num2 = index + 1;
      strArray2[index] = "refbooks.xml";
      foreach (XmlNode xmlNode in xmlNodeList)
        strArray1[num2++] = xmlNode.Value;
      return strArray1;
    }

    public byte[] GetRefBookFileContent(string fileName)
    {
      byte[] buffer;
      using (Stream stream = (Stream) File.OpenRead(Path.Combine(UnloadAccountingCard.RefBooksFolder, Path.GetFileName(fileName))))
      {
        buffer = new byte[stream.Length];
        stream.Read(buffer, 0, (int) stream.Length);
      }
      return buffer;
    }
  }
...
Рейтинг: 0 / 0
Падает веб-приложение с ошибкой "Задание не найдено"
    #39973504
felix_ff
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Vlad__i__mir,

Вам надо отдебажить запуск приложения AccountingCardTasks.exe

когда у вас запускается метод веб-сервиса UnloadCard
он как раз запускает эту задачу:
Код: sql
1.
    return TaskProcessor.Start("UnloadAccountingCard", AccountingCardTask, parameters);



раз она присутствует в файле, то TaskProcessor отработал нормально и стартовал процесс типа:

AccountingCardTasks.exe Action=unload AppId={какой то идентификатор} UserAccount={какой то пользователь} ComplexId={что то еще } OutputDir={путь выгрузки к картам}

после этого через какое то время у вас видимо проиходит вызов запроса статуса задачи, есть подозрение что к этому моменту какой то из процессов успевает очистить ту задачу, или запрос статуса приходит по другому id.

Вы можете менять сам web-сервис?
На сколько я вижу у вас asmx служба без использования Code behind, но по сути раз у вас есть ее исходник вам ничего не должно менять встроить некое логирование и скомпилить библиотеку.

Вам нужно понимать какой параметр передается в метод GetTaskStatus(string taskId ).
У меня есть подозрение что запрашивается статус какой то другой задачи.
...
Рейтинг: 0 / 0
Падает веб-приложение с ошибкой "Задание не найдено"
    #39973518
Vlad__i__mir
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
felix_ff,
Прога писалась лет 10 назад компанией, исходников нет - это я через dotPeek декомпилю её по кусочкам, а весь проект декомпилить и запустить целиком не получается

Сделал так:
Код: c#
1.
2.
3.
if ( task == null ) {
            return GenerateError("Задание не найдено. taskId:"+taskId, null); //ЗДЕСЬ ОШИБКА В ДАННОМ КЛАССЕ
        }


Вывело: taskId=5
Перед запуском в xml было:
Код: xml
1.
2.
<?xml version="1.0"?>
<tasks nextId="5"> </tasks>



стало:
Код: xml
1.
2.
<?xml version="1.0"?>
-<tasks nextId="6"> -<task lastUpdateTime="2020-06-26T14:38:59.3346992+05:00" state="Running" id="5" name="UnloadAccountingCard"> <execution progressPosition="0" progressCount="0" message="Формирование файла данных"/> </task> </tasks>
...
Рейтинг: 0 / 0
Падает веб-приложение с ошибкой "Задание не найдено"
    #39973524
Vlad__i__mir
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
felix_ff,
Vlad__i__mir,

*во время выполнения, а не "стало":
Код: xml
1.
2.
3.
<?xml version="1.0"?>
-<tasks nextId="6"> -<task lastUpdateTime="2020-06-26T14:38:59.3346992+05:00" state="Running" id="5" name="UnloadAccountingCard"> <execution progressPosition="0" progressCount="0" message="Формирование файла данных"/> </task> </tasks>
сегодня, 12:32    [22157728]     Ответить | Цитировать | Изменить Сообщить модератору



а после стало:
Код: c#
1.
2.
<?xml version="1.0"?>
<tasks nextId="6"> </tasks>



Такое ощущение, что он сперва удаляет строку с номером текущей задачи, а потом уже не может её найти
...
Рейтинг: 0 / 0
Падает веб-приложение с ошибкой "Задание не найдено"
    #39973582
felix_ff
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Vlad__i__mir,

это фигня какая то.
я бы на вашем месте разобрался кто удаляет строку, можно к примеру ProcessMonitor натравить на доступ к файлу, там явно будет уменьшение размера файла.

нужно понимать какой процесс удаляет строку, по временным меткам сможете отследить когда будет добавлена строка а когда удалена и какой процесс ее убирает.

Еще как вариант натравить дебагер на w3wp.exe под которым крутится рабочий процесс iis

Ну или может кто получше решение посоветует

+ в вашем вебсервисе в случае исключений в веб-сервисе идет проброс наверх, скорее всего где то ведется более детальный лог всего сервера приложений
...
Рейтинг: 0 / 0
Падает веб-приложение с ошибкой "Задание не найдено"
    #39973588
felix_ff
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник

кстати может достаточно поздно предлагаю: а вы на поддержку вашей "интерго" не хотите обратится?

может вам быстрее там помогут чем пытаться рабозраться в легаси коде?
...
Рейтинг: 0 / 0
Падает веб-приложение с ошибкой "Задание не найдено"
    #39973673
Vlad__i__mir
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
felix_ff

кстати может достаточно поздно предлагаю: а вы на поддержку вашей "интерго" не хотите обратится?

может вам быстрее там помогут чем пытаться рабозраться в легаси коде?


Спасибо вам за консультацию, я стал лучше понимать проблему!

Да, я им задал вопрос, и вот жду, может ответят. Программа то у нас давно уже не на поддержки
...
Рейтинг: 0 / 0
11 сообщений из 11, страница 1 из 1
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Падает веб-приложение с ошибкой "Задание не найдено"
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]