OR Return Handler Task Runbook¶
Overview¶
This is the runbook for OR Return Handler Task which covers below given components.
Catchweight products from scanned table are fetched by lookup with min in online product table and then scanned table is updated with catchweight price and weight.
Fetches all scanned products and their respective item ids from Scanned Product and online Product table.
Aggregate Items based on location id and Prepare request Payload for Stock transfer V2 POST API.
Call Stock transfer V2 POST API.
Response from stock transfer is used to update Scanned Product and Return Product table status with transfer id.
This documents (and references) the component documentation. Below are a set of scenarios that may happen in production along with diagnosis and resolution information.
This component will generate cloudwatch alarm for any ERROR or EXCEPTION. Prefix ONLINE_RETURN_HANDLER_ERROR has been configured to raise alarm for common error, DB error and API call error.
Reference¶
Docuement |
Ref |
|---|---|
Jira Story (OR Retrun Handler Service) |
|
Bitbucket (OR Retrun Handler Service) |
https://bitbucket.org/morrisonsplc/storepick-online-returns-return-handler/src/master/ |
Runtime Issue List¶
Issue |
component |
Description |
|---|---|---|
Service Call Access Failure |
Failed to Access Stock V2 Trasnfer API it raises MoriException. |
|
Data Inconsistent in Database |
RDS session is down or DB table columns missing it raises Exception. |
|
ApplicationDependencies |
Exception while loading storepick-online-returns.json config. |
|
Incorrect Config details |
Exception when details given in input data is not valid. |
Runtime Issues¶
Issue 1 (P2)¶
Scenario¶
If the request failed to access stock V2 Transfer API it raises MoriException.
Base URL¶
Error¶
- MoriException.
Symptoms¶
Stock V2 service will respond with response code 400 / 500 .
Corrective Action¶
Check if stock V2 Transfer Service is up and running.
Check both endpoint URLs are configurred correctly in config file storepick-online-returns.json.
Check SSM keys storepick_stocktransfer_secret has proper URL credentials.
Issue 2 (P1)¶
Scenario¶
If RDS session is down or scanned product data is invalid to aggregate products Store wise it raises Exception.
Error¶
sqlalchemy.exc.OperationalError
Symptoms¶
Task will stop and raise ERROR:ecstask.return_handler.service.return_stock_transfer: ONLINE_RETURN_HANDLER_ERROR - Failed to fetch records and aggregate.
Corrective Action¶
Check Postgres is up and username, password, databaseName is correct.
Check if Scanned product table in RDS has valid data.
Issue 3 (P1)¶
Scenario¶
This happens when there is an error while loading all the dependencies needed for the application to run.
Error¶
Exception raised when loading dependencies.
Symptoms¶
Config service will respond with response code 404.
Corrective Action¶
Check config file name (storepick-online-returns.json) is correct.
Check if config fields are present in the config file.
Issue 4 (P1)¶
Scenario¶
This happens when the config details in the input is not correct.
Error¶
TypeError: ‘NoneType’ object is not subscriptable.
Symptoms¶
Task will stop and raise Error pymorri.util.serverless_utils:resolve_env - input data is not: str, list or dict.
Corrective Action¶
Check config file name (storepick-online-returns.json) has correct data fields.
Check if config fields are having input value with correct details.