Skip to main content
Die Trailblazer Community auf Slack befindet sich jetzt in der offenen Betaphase – treten Sie bei und tauschen Sie sich in Echtzeit aus. Kommen Sie zu uns auf Slack

Recover from Job Failures

Learning Objectives

After completing this unit, you’ll be able to:

  • List the resources you can use to detect job problems.
  • List the general problem types.
  • Explain how to research email notification errors.
  • Explain the best way to correct job problems on a production instance.

Detect Job Problems

It’s best to be proactive when running jobs by configuring them for automatic troubleshooting. When jobs start failing, take a step back and collect data to figure out what happened.

A proactive approach means that you configure all jobs to send an email to you, the admin, if they run for more than a specified time. This notification eliminates the element of surprise.

Sometimes, a job has problems that Salesforce B2C Commerce records in the log but they don’t actually stop the job. If these errors persist and are significant, you add processing to your job pipelines to detect the problem and stop the job. Plan to check logs regularly to identify problems—chronic or otherwise.

Configure Email Notification

You configure email notifications by setting values in individual schedules or job configurations. To keep things simple, use the same email template for all email notifications.

B2C Commerce sends notifications in a standard text file and includes:

  • From address
  • To list
  • Subject
  • Body text

If you leave the mail server unconfigured for error notifications, you look at the log files. B2C Commerce logs errors in both the system error log and the syslog.

Resolve Stuck Jobs and Lock Issues

If a job gets stuck in the Running status and acquires at least one lock, release the lock before running the job again. How you release the lock depends on the type of instance on which the job is running.

Release a Lock on an On-Demand Sandbox (ODS)

  1. In Control Center, stop the ODS instance.
  2. In Business Manager, click App Launcher, and select Administration | Operations | Jobs.
  3. Locate the stuck job. You can use the search functionality or browse through the list of jobs.
  4. Click the job to view its details. This action shows you the status and any locks.
  5. Click Release Lock. This option is typically available for admins.
  6. Confirm the action. This setting frees up the resources and allows other jobs to proceed.
  7. In Control Center, start the production instance.

Release a Lock on a Production Instance

  1. In Business Manager, click App Launcher, and select Administration | Operations | Jobs.
  2. Locate the job that is stuck. You can use the search functionality or browse through the list of jobs.
  3. Click the job to view its details. This action shows you the status and any locks.
  4. Click Release Lock. This option is typically available for admins.
  5. Confirm the action. This setting frees up the resources and allows other jobs to proceed.
  6. In Control Center, restart the Production instance.

Recover from Network Interruptions

If a job terminates because the instance went down, or a job terminates part of the way through, the data might be a mix of updated and old. Run the job again.

Correct Data Errors

To troubleshoot data errors, try the following.

Recover Method

Description

Replicate data from another instance.

Use when a problem exists with importing into a production instance and the staging instance has the correct data to roll back to.

Import a new feed produced by the backend system.

Use after fixing the data in the backend system and generating a new feed. This is the most common method for recovery.

Use data from import feed archives.

Use if a problem occurs with the backend system producing the feed. For this data to be available, it requires that you have a system that archives feeds and cleans up archived feeds.

Use data from regular exports.

Use for data on the production instance, such as product availability, or data imported directly into production, such as price books. For this data to be available, you create a job that exports the required data. This approach is also useful for data that exists only in Business Manager, not the backend system, such as web-specific attributes or URL attributes.

Manage Data Imports on the Production Instance

Usually, when you transfer data to the production instance, you perform a data replication from the staging instance. However, for frequent imports of pricing, inventory, or other kinds of data, you use jobs to transfer the data directly from the external source into production. As with staging, you can experience interrupted jobs resulting in mixed data on the production instance.

Archive Sites to Enable Rollback

Because you can’t automatically roll back production instances impacted by job issues, you always create an archive of your existing site to roll back to if the job fails.

Sum It Up

In this unit, you learned how to troubleshoot job errors in various situations. You also learned about the importance of an archival process and regular (frequent) error log checks.

In this badge, you learned how to create, configure, and manage Salesforce B2C Commerce scheduled jobs to automate tasks like data imports and maintenance. You explored how to use key job concepts, such as flows, scope, locks, and schedules, to ensure data integrity. Finally, you reviewed best practices for troubleshooting and recovering from job failures.

Resources

Teilen Sie Ihr Trailhead-Feedback über die Salesforce-Hilfe.

Wir würden uns sehr freuen, von Ihren Erfahrungen mit Trailhead zu hören: Sie können jetzt jederzeit über die Salesforce-Hilfe auf das neue Feedback-Formular zugreifen.

Weitere Infos Weiter zu "Feedback teilen"