דילוג לתוכן
  • דף הבית
  • קטגוריות
  • פוסטים אחרונים
  • משתמשים
  • חיפוש
  • חוקי הפורום
כיווץ
תחומים

תחומים - פורום חרדי מקצועי

💡 רוצה לזכור קריאת שמע בזמן? לחץ כאן!
  1. דף הבית
  2. תכנות
  3. לוגי שגיאה בnodejs וyemotrouter מה הגורם לקריסה?

לוגי שגיאה בnodejs וyemotrouter מה הגורם לקריסה?

מתוזמן נעוץ נעול הועבר תכנות
2 פוסטים 2 כותבים 14 צפיות 1 עוקבים
  • מהישן לחדש
  • מהחדש לישן
  • הכי הרבה הצבעות
תגובה
  • תגובה כנושא
התחברו כדי לפרסם תגובה
נושא זה נמחק. רק משתמשים עם הרשאות מתאימות יוכלו לצפות בו.
  • E מנותק
    E מנותק
    eido
    כתב נערך לאחרונה על ידי eido
    #1

    יש כאן כמה לוגים של שגיאה, רק אחד מהם גרם לקריסה ממש, אשמח לדעת מה גרם לקריסה, ומה הוא שונה מהשאר. לכאורה הם בערך אותם שגיאות.

    [541eba6e6682e37cee0ae3e53f2d794defc28d29]: 💥 Uncaught error. applying uncaughtErrorHandler (node:internal/errors:405:5)
    Uncaught error in / from 0548497730. error stack: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at new NodeError (node:internal/errors:405:5)
    at ServerResponse.setHeader (node:_http_outgoing:655:11)
    at ServerResponse.header (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:684:10)
    at ServerResponse.send (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:161:12)
    at Call.send (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:264:18)
    at sendResp (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:170:18)
    at Call.read (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:179:15)
    at choosestreet (file:///home/node.stamandsefer.co.il/public_html/src/utils/utils_func.js:141:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async callHandler (file:///home/node.stamandsefer.co.il/public_html/src/controllers/addAdController.js:60:22)
    [541eba6e6682e37cee0ae3e53f2d794defc28d29]: Cannot send id_list_message after sending response (probably done from uncaughtErrorHandler due to error in asynchronous code

    [a7d099fc6c8dea530efaabba6c1b4ceb5476adb8]: 💥 Uncaught error. applying uncaughtErrorHandler (node:internal/errors:405:5)
    Uncaught error in / from 0548497730. error stack: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at new NodeError (node:internal/errors:405:5)
    at ServerResponse.setHeader (node:_http_outgoing:655:11)
    at ServerResponse.header (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:684:10)
    at ServerResponse.send (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:161:12)
    at Call.send (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:264:18)
    at sendResp (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:170:18)
    at Call.read (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:179:15)
    at choosestreet (file:///home/node.stamandsefer.co.il/public_html/src/utils/utils_func.js:141:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async callHandler (file:///home/node.stamandsefer.co.il/public_html/src/controllers/addAdController.js:60:22)
    [a7d099fc6c8dea530efaabba6c1b4ceb5476adb8]: Cannot send id_list_message after sending response (probably done from uncaughtErrorHandler due to error in asynchronous code

    [b142a8637dd7dced030099e0f6655a63da484e0b]: 💥 Uncaught error. applying uncaughtErrorHandler (node:internal/errors:405:5)
    Uncaught error in / from 0583297790. error stack: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at new NodeError (node:internal/errors:405:5)
    at ServerResponse.setHeader (node:_http_outgoing:655:11)
    at ServerResponse.header (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:684:10)
    at ServerResponse.send (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:161:12)
    at Call.send (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:264:18)
    at sendResp (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:170:18)
    at Call.read (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:179:15)
    at choosestreet (file:///home/node.stamandsefer.co.il/public_html/src/utils/utils_func.js:141:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async callHandler (file:///home/node.stamandsefer.co.il/public_html/src/controllers/addAdController.js:60:22)
    [b142a8637dd7dced030099e0f6655a63da484e0b]: Cannot send id_list_message after sending response (probably done from uncaughtErrorHandler due to error in asynchronous code after returning response)
    Node starting...
    app.js running on port 3000

    export async function choosestreet(call, city) {
            let menuStreet = "", digitsStreet=[], street;
    
        let okStreet = "0";
        while(okStreet!="1")
        {
            let ans = await call.read([{ type: 'file', data: "/ivr_records/רחוב1" }], "record");
            console.log(ans);
        try{
            const keywords = JSON.stringify(streets[city]);
    street = await reco(call, ans,keywords, city);
    if (street==null) {continue;}
    }
        catch (error) {
         console.error("Error:", error);
         call.id_list_message([{ type: 'text', data: "אירעה שגיאה" }]);
    }
    {
        // מבקש אישור
        okStreet = await call.read([{ type: 'file' , data: `/ivr_records/${street}` },{ type: 'file' , data: "/ivr_records/אישור2" }], 'tap', {
                sec_wait: 2,
                min_digits: 1,
            typing_playback_mode: "No",
            digits_allowed: [1,2, "*0"]
        });
        if (okStreet=="1")
        {return street;}
        else if (okStreet == "*0") {call.go_to_folder(mainextPath);}
        }
    
    }
    
    async function reco(call, ans, keywords,city) {
        try{
     const { stdout, stderr } = await execFileAsync("python3", [
             "/recognizeNew.py",
            ans,keywords]);   
            const matches = JSON.parse(stdout);
    
    console.log(matches);
    if (stderr) {
        console.error("Python stderr:", stderr);
    }
    if (matches.length==0)
    {
              const { stdout, stderr } = await execFileAsync("python3", [
             "recognize.py",
            ans,keywords]);
            if (stderr) {
        console.error("Python stderr:", stderr);
    }
             let recognizedText = stdout.trim(); // הסר רווחים ושורות מיותרות
          
           if(streets[city].includes(recognizedText))
           {
            return recognizedText;
           }
           else
           {call.id_list_message([/*{type: 'text', data: "לא זיהינו את הרחוב שהקלטת"}*/{ type: 'file', data: "/ivr_records/שגיאה זיהוי" }],{prependToNextAction: true});}
    }
    else 
    if (matches[0].score == 100)
    {return matches[0].name;}
    else
    {
        let msgmatches = [], digitsmatches=[];
        for (let i = 0; i < matches.length; i++) {
    
            msgmatches.push({ type: 'file', data: `/ivr_records/${matches[i].name}` });
            msgmatches.push({ type: 'file', data: `/ivr_records/הקש` });
            msgmatches.push(...Object.values(numberToHebrewWords(i+1)));
            digitsmatches.push((i + 1).toString());
        }
        digitsmatches.push("*0");
    
        let street;
        for(let i = 0; i<3; i++)
        {
    
    
        street = await call.read(msgmatches, 'tap', {
            max_digits: 2,
                sec_wait: 2,
                min_digits: 1,
                digits_allowed: digitsmatches,
            typing_playback_mode: "No"
        });
    
        if (street == "*0") {call.go_to_folder(mainextPath);}
    
    
            if (!digitsmatches.includes(street)) {
            continue; // אם הקיש מספר לא חוקי – חוזר על הלולאה
        }
    
        const index = Number(street) - 1;
        if (index >= matches.length) {
            continue; // אם הקיש מספר לא חוקי – חוזר על הלולאה
        }
        street = matches[index].name;
        return street;
    }
    call.hangup();
    
    }
        }
        catch (error) {
         console.error("Error:", error);
         call.id_list_message([{ type: 'text', data: "אירעה שגיאה" }]);
    }
    }
    
    ש תגובה 1 תגובה אחרונה
    0
    • E eido

      יש כאן כמה לוגים של שגיאה, רק אחד מהם גרם לקריסה ממש, אשמח לדעת מה גרם לקריסה, ומה הוא שונה מהשאר. לכאורה הם בערך אותם שגיאות.

      [541eba6e6682e37cee0ae3e53f2d794defc28d29]: 💥 Uncaught error. applying uncaughtErrorHandler (node:internal/errors:405:5)
      Uncaught error in / from 0548497730. error stack: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
      at new NodeError (node:internal/errors:405:5)
      at ServerResponse.setHeader (node:_http_outgoing:655:11)
      at ServerResponse.header (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:684:10)
      at ServerResponse.send (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:161:12)
      at Call.send (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:264:18)
      at sendResp (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:170:18)
      at Call.read (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:179:15)
      at choosestreet (file:///home/node.stamandsefer.co.il/public_html/src/utils/utils_func.js:141:30)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async callHandler (file:///home/node.stamandsefer.co.il/public_html/src/controllers/addAdController.js:60:22)
      [541eba6e6682e37cee0ae3e53f2d794defc28d29]: Cannot send id_list_message after sending response (probably done from uncaughtErrorHandler due to error in asynchronous code

      [a7d099fc6c8dea530efaabba6c1b4ceb5476adb8]: 💥 Uncaught error. applying uncaughtErrorHandler (node:internal/errors:405:5)
      Uncaught error in / from 0548497730. error stack: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
      at new NodeError (node:internal/errors:405:5)
      at ServerResponse.setHeader (node:_http_outgoing:655:11)
      at ServerResponse.header (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:684:10)
      at ServerResponse.send (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:161:12)
      at Call.send (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:264:18)
      at sendResp (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:170:18)
      at Call.read (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:179:15)
      at choosestreet (file:///home/node.stamandsefer.co.il/public_html/src/utils/utils_func.js:141:30)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async callHandler (file:///home/node.stamandsefer.co.il/public_html/src/controllers/addAdController.js:60:22)
      [a7d099fc6c8dea530efaabba6c1b4ceb5476adb8]: Cannot send id_list_message after sending response (probably done from uncaughtErrorHandler due to error in asynchronous code

      [b142a8637dd7dced030099e0f6655a63da484e0b]: 💥 Uncaught error. applying uncaughtErrorHandler (node:internal/errors:405:5)
      Uncaught error in / from 0583297790. error stack: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
      at new NodeError (node:internal/errors:405:5)
      at ServerResponse.setHeader (node:_http_outgoing:655:11)
      at ServerResponse.header (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:684:10)
      at ServerResponse.send (/home/node.stamandsefer.co.il/public_html/node_modules/express/lib/response.js:161:12)
      at Call.send (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:264:18)
      at sendResp (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:170:18)
      at Call.read (file:///home/node.stamandsefer.co.il/public_html/node_modules/yemot-router2/lib/call.js:179:15)
      at choosestreet (file:///home/node.stamandsefer.co.il/public_html/src/utils/utils_func.js:141:30)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async callHandler (file:///home/node.stamandsefer.co.il/public_html/src/controllers/addAdController.js:60:22)
      [b142a8637dd7dced030099e0f6655a63da484e0b]: Cannot send id_list_message after sending response (probably done from uncaughtErrorHandler due to error in asynchronous code after returning response)
      Node starting...
      app.js running on port 3000

      export async function choosestreet(call, city) {
              let menuStreet = "", digitsStreet=[], street;
      
          let okStreet = "0";
          while(okStreet!="1")
          {
              let ans = await call.read([{ type: 'file', data: "/ivr_records/רחוב1" }], "record");
              console.log(ans);
          try{
              const keywords = JSON.stringify(streets[city]);
      street = await reco(call, ans,keywords, city);
      if (street==null) {continue;}
      }
          catch (error) {
           console.error("Error:", error);
           call.id_list_message([{ type: 'text', data: "אירעה שגיאה" }]);
      }
      {
          // מבקש אישור
          okStreet = await call.read([{ type: 'file' , data: `/ivr_records/${street}` },{ type: 'file' , data: "/ivr_records/אישור2" }], 'tap', {
                  sec_wait: 2,
                  min_digits: 1,
              typing_playback_mode: "No",
              digits_allowed: [1,2, "*0"]
          });
          if (okStreet=="1")
          {return street;}
          else if (okStreet == "*0") {call.go_to_folder(mainextPath);}
          }
      
      }
      
      async function reco(call, ans, keywords,city) {
          try{
       const { stdout, stderr } = await execFileAsync("python3", [
               "/recognizeNew.py",
              ans,keywords]);   
              const matches = JSON.parse(stdout);
      
      console.log(matches);
      if (stderr) {
          console.error("Python stderr:", stderr);
      }
      if (matches.length==0)
      {
                const { stdout, stderr } = await execFileAsync("python3", [
               "recognize.py",
              ans,keywords]);
              if (stderr) {
          console.error("Python stderr:", stderr);
      }
               let recognizedText = stdout.trim(); // הסר רווחים ושורות מיותרות
            
             if(streets[city].includes(recognizedText))
             {
              return recognizedText;
             }
             else
             {call.id_list_message([/*{type: 'text', data: "לא זיהינו את הרחוב שהקלטת"}*/{ type: 'file', data: "/ivr_records/שגיאה זיהוי" }],{prependToNextAction: true});}
      }
      else 
      if (matches[0].score == 100)
      {return matches[0].name;}
      else
      {
          let msgmatches = [], digitsmatches=[];
          for (let i = 0; i < matches.length; i++) {
      
              msgmatches.push({ type: 'file', data: `/ivr_records/${matches[i].name}` });
              msgmatches.push({ type: 'file', data: `/ivr_records/הקש` });
              msgmatches.push(...Object.values(numberToHebrewWords(i+1)));
              digitsmatches.push((i + 1).toString());
          }
          digitsmatches.push("*0");
      
          let street;
          for(let i = 0; i<3; i++)
          {
      
      
          street = await call.read(msgmatches, 'tap', {
              max_digits: 2,
                  sec_wait: 2,
                  min_digits: 1,
                  digits_allowed: digitsmatches,
              typing_playback_mode: "No"
          });
      
          if (street == "*0") {call.go_to_folder(mainextPath);}
      
      
              if (!digitsmatches.includes(street)) {
              continue; // אם הקיש מספר לא חוקי – חוזר על הלולאה
          }
      
          const index = Number(street) - 1;
          if (index >= matches.length) {
              continue; // אם הקיש מספר לא חוקי – חוזר על הלולאה
          }
          street = matches[index].name;
          return street;
      }
      call.hangup();
      
      }
          }
          catch (error) {
           console.error("Error:", error);
           call.id_list_message([{ type: 'text', data: "אירעה שגיאה" }]);
      }
      }
      
      ש מנותק
      ש מנותק
      ששא
      כתב נערך לאחרונה על ידי
      #2

      @eido כי יש כמה פעמים שאתה מחזיר משהו אבל אתה לא עוצר את הקוד, כך שהקוד ממשיך לרוץ ומחזיר כמה דברים ביחד, וזה מה שגורם לשגיאות כאלה

      תגובה 1 תגובה אחרונה
      0
      תגובה
      • תגובה כנושא
      התחברו כדי לפרסם תגובה
      • מהישן לחדש
      • מהחדש לישן
      • הכי הרבה הצבעות


      בא תתחבר לדף היומי!
      • התחברות

      • אין לך חשבון עדיין? הרשמה

      • התחברו או הירשמו כדי לחפש.
      • פוסט ראשון
        פוסט אחרון
      0
      • דף הבית
      • קטגוריות
      • פוסטים אחרונים
      • משתמשים
      • חיפוש
      • חוקי הפורום