4

このアドレスにアクセスすると、時々このエラーが発生します。

http://apps.facebook.com/pazooza

iisnode encountered an error when processing the request.

HRESULT: 0x2
HTTP status: 500
HTTP reason: Internal Server Error
You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.

In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.

You may get additional information about this error condition by logging stdout and stderr of the node.exe process.To enable logging, set the system.webServer/iisnode/@loggingEnabled configuration setting to 'true' (current value is 'false').

しかし、更新を押すと、サイトが正しく読み込まれ、すべてが正常に機能しています。サイトを数時間離れて戻ってきたときにのみ、このエラーが再び表示されるか、表示されない可能性があります. 私のサイトに移動するユーザーは、サイトが壊れていると考え、更新する傾向がないため、面倒です!

だから私の質問は、あなたのコードをチェックしたところ、すべてが正しくサイトがロードされているように見えますが、ノードまたはIISノードがこのエラーをチャックすることがあります。

私のセットアップは次のとおりです。

サーバー: Windows Azure/Web サイト (共有、2 つのインスタンス) 言語: Node.js ツール: Webmatrix (テンプレート プロジェクトのスターター サイトを使用)

最も厄介なことは、エラー メッセージなどのログ記録を有効にしたのに、ログ システムがこのエラーを検出していないことです。ログを確認すると、このエラーが発生したときにエラー ログが作成されません。捉える方法を考え出した。誰にも何か提案がありますか?

これは私のserver.jsファイルがどのように見えるかです:

var express = require('express')
  , connect = require('connect')
  , config = require('./utils/config')
  , observer = require('./utils/observer')
  , cronJob = require('cron').CronJob
  , azure = require('azure')
  , uuid = require('node-uuid')
  , db = require("./utils/database")
  , async = require('async')
  , serialNumbers = require("./utils/serialNumbers");

var app = module.exports = express.createServer();

// Create a cron job to listen for servicebus queue messages
var jobProcessServices = new cronJob({
    cronTime: '*/1 * * * * *',
    onTick: function () {
        observer.processQueue(function () { });
    },
    start: false
});

app.configure(function() { 
    app.set('views', __dirname + '/views');
    app.set('view engine', 'ejs');
    app.set('view options', {
      layout: false
    });
    app.use(express.favicon());
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(connect.static(__dirname + '/public'));
    app.use(require('./middleware/siteTotals'));
    app.use(require('./middleware/authenticate'));
    app.use(express.cookieParser());
    app.use(express.session({ secret: 'ljklkdsflkfdj4848384' }));
    app.use(app.router);

    // start listening for queue messages
    jobProcessServices.start();
    console.log('starting job service\n\n');

    // create table stores
    var ts1 = azure.createTableService(config.storageAccount, config.storageAccessKey, config.tableHost);

    ts1.createTableIfNotExists('channels', function(error) {
        ts1.createTableIfNotExists('users', function(error) {
            ts1.createTableIfNotExists('snusers', function(error) {
                ts1.createTableIfNotExists('snchannels', function(error) {
                    var query = azure.TableQuery
                        .select()
                        .from('snchannels');

                    ts1.queryEntities(query, function(error, result) {
                        if(error === null && result.length == 0) {
                            // must be site initialization, generate serial numbers for channels and users
                            serialNumbers.generateNewNumbers('snchannels', config.maxNumber, config.usageRates[2], function() {
                                serialNumbers.generateNewNumbers('snusers', config.maxNumber, config.usageRates[2], function() {
                                    initializeDefaultQueues(function() {
                                        // Create default storage container
                                        var bc1 = azure.createBlobService(config.storageAccount, config.storageAccessKey, config.blobHost);
                                        bc1.createContainerIfNotExists(config.container, function () { });
                                    });
                                });
                            });
                        }
                        else initializeDefaultQueues(function() { });
                    }); 
                });
            });
        });
    });

    ts1.createTableIfNotExists('sitetotals', function(error) {
        if(error === null) {
            var query = azure.TableQuery
                .select()
                .from('sitetotals');

            ts1.queryEntities(query, function(error, siteTotals) {
                if(error === null && siteTotals.length == 0) {
                    // must be site initialization create defaults
                    ts1.insertEntity('sitetotals', { PartitionKey: 'users', RowKey: uuid(), Total: '0', Deleted: '0' }, function(error) {
                        ts1.insertEntity('sitetotals', { PartitionKey: 'channels', RowKey: uuid(), Total: '0', Deleted: '0' }, function(error){ });
                    });
                }
            });
        }
    });
});

/**
* ERROR MANAGEMENT
* -------------------------------------------------------------------------------------------------
* error management - instead of using standard express / connect error management, we are going
* to show a custom 404 / 500 error using jade and the middleware errorHandler (see ./middleware/errorHandler.js)
**/
var errorOptions = { dumpExceptions: true, showStack: true }
app.configure('development', function() { });
app.configure('production', function() {
    errorOptions = {};
});
app.use(require('./middleware/errorHandler')(errorOptions));

// static vars
app.helpers({ config: {
        fbAppNamespace: config.fbAppNamespace,
        siteUrl: config.siteUrl,
        canvasUrl: config.canvasUrl,
        appID: config.appID,
        commentPageSize: config.commentPageSize,
        videoPageSize: config.videoPageSize,
        channelPageSize: config.channelPageSize,
        userFollowPageSize: config.userFollowPageSize,
        followPageSize: config.followPageSize,
        friendPageSize: config.friendPageSize,
        pazoozaFbUrl: config.pazoozaFbUrl,
        pazoozaTwitterUrl: config.pazoozaTwitterUrl,
        anonymousUser: config.anonymousUser,
        usageRates: config.usageRates,
        categorys: config.categorys,
        channelTypes: config.channelTypes,
        ratings: config.ratings
    },
    serverYear: new Date().getFullYear()
});

// all views have access to these variables
// note: can't do http calls with these functions
app.dynamicHelpers({
    session: function (req, res) {
        return req.session;
    },
    signed_request: function (req, res) {
        return req.param('signed_request');
    }
});

/**
* ROUTING
* -------------------------------------------------------------------------------------------------
* include a route file for each major area of functionality in the site
**/

require('./routes/home')(app);
require('./routes/channel')(app);
require('./routes/user')(app);
require('./routes/search')(app);
require('./routes/utils')(app);
require('./routes/facebook')(app);
require('./routes/testing')(app);

// Global Routes - this should be last!
require('./routes/global')(app);

app.listen(process.env.PORT || 3000);
console.log("Express server in %s mode", app.settings.env);

// helper functions
function initializeDefaultQueues(callback){
    // create default service bus message queues
    var qs1 = azure.createQueueService(config.storageAccount, config.storageAccessKey, config.queueHost);
    qs1.createQueueIfNotExists('serialnumbers', function(error){
        callback();
    });
}

アプリをインストールする Facebook ユーザーを管理し、Facebook ユーザーの FB 情報が常にアプリケーションで利用できるようにする、siteTotals や authenticate などのミドルウェア モジュールがあります。

IISNode の最新バージョンをインストールする必要があるのでしょうか? IISNode のバージョンと更新が必要かどうかを確認するにはどうすればよいですか?

また、このエラーは Windows Azure Websites Mode が FREE、SHARE、RESERVED のいずれであるかに関係なく発生することにも注意してください。

そして、ここに私のweb.configファイルがあります:

<iisnode      
 node_env="%node_env%"
 nodeProcessCommandLine="&quot;%programfiles%\nodejs\node.exe&quot;"
 nodeProcessCountPerApplication="1"
 maxConcurrentRequestsPerProcess="1024"
 maxNamedPipeConnectionRetry="3"
 namedPipeConnectionRetryDelay="2000"      
 maxNamedPipeConnectionPoolSize="512"
 maxNamedPipePooledConnectionAge="30000"
 asyncCompletionThreadCount="0"
 initialRequestBufferSize="4096"
 maxRequestBufferSize="65536"
 watchedFiles="*.js;node_modules\*;routes\*.js;views\*.jade;middleware\*.js;iisnode.yml"
 uncFileChangesPollingInterval="5000"      
 gracefulShutdownTimeout="60000"
 loggingEnabled="true"
 debuggingEnabled="false"
 debuggerPortRange="5058-6058"
 debuggerPathSegment="debug"
 maxLogFileSizeInKB="128"
 devErrorsEnabled="true"
 flushResponse="false"      
 enableXFF="false"
 promoteServerVars=""
 />

このプロジェクト全体を開始するために使用した Webmatrix テンプレートを使用するときに作成される標準ファイルです。

4

3 に答える 3

0

iisnode.yml がある場合は、それを使用してログとデバッグを有効にします。iisnode.yml は web.config のすべての設定をオーバーライドします。ドロップするデフォルトの設定では、運用アプリの通常の設定であるため、deverrors とログの両方が無効になります。iisnode.yml を編集してこれらの値を変更すると、ログが有効になります。

于 2012-12-08T00:36:08.257 に答える
0

データベースとして mongolab バックエンドを使用する Node サイトでも同様の問題がありました。問題を解決するために、接続文字列にキープアライブ フラグを追加 (およびオンに設定) しました。この問題は azure の負荷分散が原因だったと思いますが、Amazon に移行したときに正確に把握するのに時間を費やすことはありませんでした。それがあなたを助けることを願っています。

于 2012-12-03T17:58:54.140 に答える
0

アプリケーションの詳細を教えていただけますか? 特にアプリケーションが接続しているリソースに関する情報がなければ、正確な問題を特定することは困難です。

この問題は、非アクティブな状態が一定期間続いた後にアプリケーションが更新されたことが原因である可能性があります。Web サイトは共有されているため、アプリケーション密度を向上させるために使用されていない場合、各サイトは定期的に更新されます。アプリケーションの再起動後に接続を再確立する必要があるリソースがいくつかある可能性があります。

iisnode.yml ファイルを編集して loggingEnabled=true を設定し、ログをダウンロード (クロスプラットフォーム ツールを使用して azure サイトのログをダウンロード) することで、エラー (基本的には stdout または stderr ストリームに記録されたすべてのデータ) の詳細を取得できます。

-マーク

于 2012-12-03T19:05:28.810 に答える