Skip to main content
Skip table of contents

Payment processes debugging steps

This documents the various steps that can be taken, to identify the status of a running/stuck process:

RESQUE

  1. Check the Resque queue of the concerned environment, if a process is running there related to payment releases.

  2. Check the worker's process ID (PID) to identify which worker is running the stuck process.

    1. Click on the process to get more info & id.

    2. You can use the ps command or the Resque.worker object to get the PID.

  3. Check in the batch processes for the above process id in the SQL server (batch_processes table)

SQL

  1. Use the SQL Server to run sp.blitzWho & view to identify the details of the actively running queries. You can then use the sys.dm_exec_requests view to get more information about the request.

  2. Check for blocking session ids if present & if the i/o are increasing or not.

    1. If no blocking ids are present, and I/O read/write operations are increasing, that refers to the process being currently run, and not stuck.

  3. To check further details, get the query & search in the payment_releaser.rb

    1. If may be a direct query or a rails query.

LOGS

  1. Check for posting_engine.log to identify where the process is running/stuck currently.

  2. Check for performance loggers.

    1. For this to be working, features.log_performance should be enabled in config.yml (default value is false)

  3. There are few methods in the payment_releaser.rb prefixed with profile. These methods make it to the performance.log logger, with the entry and exit time, and can help identify where the process might be currently stuck/executing.

  4. Figure out the file name from process_records_into_files method in payment_releaser.rb. Check if the new file(.dat) has been created with the help of DEVOPS. Note down the size of the file, and check if the size is increasing or not.

    1. If it is increasing in size, means the process is not stuck.

  5. If the file size is not increasing even after 3-4 hours, then we can do the following to reset the payment process:

    1. Check with the user, on details of what payments were being released: type, count, accounting date etc.

    2. Identify all the payments that are to be released.

    3. Check if all the payments have been marked released.

      1. If all the payments are marked released, we just need to manually finish the process.

      2. Set the finished_at in batch_processes for the respective process

      3. Run flush_jobs

    4. If (c) is not the case, and we are 100% confirm that the process is stuck, proceed to reset the process

RESET PROCESS

NOTE: This should be treated as extreme measures. Process is slow at times, and RESET should not be considered unless everything above has been verified thoroughly

  1. Check and confirm that no other process than the payment releaser is running.

  2. Kill the resque job via flush_jobs

  3. If the payment type is check, we need to reset the check number as well first

    1. Next number of the bank account(where payment type=”Check”) needs to be reset

    2. Identify the minimum payment_number(s) from the affected payments w.r.t the bank accounts

    3. For each bank account, update the next number as the minimum number received from (3.b)

  4. Reset the payments, replacing xxx with the affected payment ids:

CODE
UPDATE ap_payments 
SET payment_number = NULL,
    released = NULL,
    status = 'Pending' 
WHERE id in (xxx)

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.