digitalcredentials / dcc-admin-dashboard

Admin tool for issuing DCC Verifiable Credentials
MIT License
2 stars 4 forks source link

Errors When Uploading CSV File #51

Open kayaelle opened 2 months ago

kayaelle commented 2 months ago

Describe the bug For the "WIT Mock MIT Degree" Batch - using the Mock MIT Bachelor of Science Degree w/render credential template - uploading the attached csv file results in an internal server error in the console. On the screen it looks like the file didn't upload but if you go back to the batch from the issuance overview, it lists the credential recipients but with a "CSV is missing the following fields: earnerName, subject, credentialName, emailAddress." and that isn't true.

I've checked for special characters, spaces, and blank lines in the csv file using both excel and textedit. I believe this is a problem with the csv file but can't track it down. Once we figure out the issue with the csv file, we should look into how to return an error in the interface that matches the actual issue with the csv file WIT MIT Bachelor of Science Degree.csv .

To Reproduce Steps to reproduce the behavior:

  1. Go to https://dashboard.dcconsortium.org/admin/collections/credential-batch/6632509a883e43486eeb18cd?page=0)(https://dashboard.dcconsortium.org/admin/collections/credential-batch/6632509a883e43486eeb18cd?page=0)
  2. Click continue until you get to the "Upload & Manage Earner Information" screen
  3. Open console
  4. Upload attached csv file
  5. See error in console
  6. Go back to https://dashboard.dcconsortium.org/admin/collections/credential-batch/6632509a883e43486eeb18cd?page=0)
  7. Click through to "Upload & Manage Earner Information" screen to see list of earners and their info with an error message and disabled continue button.

Expected behavior This csv file should be uploaded successfully. Note that if uploaded on the credential template, it validates.

kayaelle commented 2 months ago

Labeled as priority for the issue that may affect others but not for this particular credential issuing (they're fake demo credentials going to fake email addresses)

jchartrand commented 2 months ago

Likely that this email address in the CSV is invalid:

alovelace0-mail.com

At least I'm guessing so, based on the docker logs for the dashboard, which show an error:

ValidationError: The following field is invalid: emailAddress ad-payload | at beforeChange (/home/node/app/nodemodules/.pnpm/payload@1.13.4@types+react@18.2.67_typescript@5.4.2/node_modules/payload/src/fields/hooks/beforeChange/index.ts:55:11) ad-payload | at processTicksAndRejections (node:internal/process/task_queues:95:5) ad-payload | at create (/home/node/app/nodemodules/.pnpm/payload@1.13.4@types+react@18.2.67_typescript@5.4.2/node_modules/payload/src/collections/operations/create.ts:179:29) ad-payload | at /home/node/app/src/endpoints/createCredentialsForBatch.ts:16:45 ad-payload | at async Promise.all (index 0) ad-payload | at createBatchCredentials (/home/node/app/src/endpoints/createCredentialsForBatch.ts:14:25) { ad-payload | status: 400, ad-payload | data: [ ad-payload | { ad-payload | message: 'Please enter a valid email address.', ad-payload | field: 'emailAddress' ad-payload | } ad-payload | ], ad-payload | isPublic: false, ad-payload | isOperational: true ad-payload | } ad-payload | ValidationError: The following field is invalid: emailTemplate

kayaelle commented 1 month ago

Recommended next steps: