Resolution

How to recover from Snyk errors during an Xray 3 Upgrade

AuthorFullName__c
Patrick Russell
articleNumber
000004795
ft:sourceType
Salesforce
FirstPublishedDate
2020-04-20T20:56:58Z
lastModifiedDate
2021-10-27
VersionNumber
4

You need to correct the offending table row in the MongoDB, then force restart the migration.


1. Login to MongoDB:

#Password may be under /root if "password" does not work
mongo -u xray -p password --authenticationDatabase xray --authenticationMechanism SCRAM-SHA-1

2. Within MongoDB switch to the Xray db

use xray

3. Execute the following query, it shortens the URL block to below 64 characters:

db.vulnerabilities.update({"_id":"XRAY-67456"}, {"$set":{"sources": [
{
"name" : "Snyk VulnDB",
"source_id" : "jfrog-fix",
"url" : "https://snyk.io/vuln/SNYK-DOTNET-60242"
}
]}})

4. Login to PostgreSQL

#/opt/PostgreSQL/9.6/bin
#Default Password: "xray"
./psql xraydb xray

5. In the PostgreSQL database, run the below query. It restarts the migration.
 
DELETE FROM db_migrations_running;

6. Restart Xray