Skip to content

V5 not support new Challenge UUID #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
luizrrodrigues opened this issue Jun 5, 2020 · 48 comments
Closed

V5 not support new Challenge UUID #179

luizrrodrigues opened this issue Jun 5, 2020 · 48 comments

Comments

@luizrrodrigues
Copy link

Issue: submissions_api not support new challenge UUID, only accept legacyId:
image

@rootelement I can't assign in this repo.

@callmekatootie
Copy link
Contributor

It definitely does support UUIDs. The error that you are getting seems to be coming from Elasticsearch. Need to check what's up there...

@rootelement
Copy link
Contributor

rootelement commented Jun 5, 2020 via email

@callmekatootie
Copy link
Contributor

It actually is. Here's the schema:

challengeId: joi.alternatives().try(joi.id(), joi.string().uuid()).required(),

The test data that we used in the past too had UUIDs (we changed them to legacy to keep it realistic)... hence curious as to why elasticsearch complained. Will check and get back with my findings...

@sushilshinde
Copy link
Contributor

@callmekatootie what's ETA on this?

callmekatootie added a commit that referenced this issue Jun 25, 2020
callmekatootie added a commit that referenced this issue Jun 25, 2020
callmekatootie added a commit that referenced this issue Jun 25, 2020
@callmekatootie
Copy link
Contributor

Full error log:

{
  "error": {
    "root_cause": [
      {
        "type": "query_shard_exception",
        "reason": "failed to create query: <redacted_by_me_for_legibility>",
        "index_uuid": "akoBLOAxRbyavEtOx7Fe6A",
        "index": "submission-index"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "submission-index",
        "node": "lPmhSsTlSH2vMYiWrqN4Ig",
        "reason": {
          "type": "query_shard_exception",
          "reason": "failed to create query: <redacted_by_me_for_legibility>",
          "index_uuid": "akoBLOAxRbyavEtOx7Fe6A",
          "index": "submission-index",
          "caused_by": {
            "type": "number_format_exception",
            "reason": "For input string: \"9146ff17-7a4d-41f3-812b-7471bd692fb0\""
          }
        }
      }
    ]
  },
  "status": 400
}

<redacted_by_me_for_legibility> = same as the text seen in the POSTMAN screenshot

Important bit in the error message above:

          "caused_by": {
            "type": "number_format_exception",
            "reason": "For input string: \"9146ff17-7a4d-41f3-812b-7471bd692fb0\""
          }

Cause of issue seems to be that the challengeId seems to have been dynamically mapped as a number and not as a string.

Checked the mappings and indeed - challengeId is mapped as long data type.

@rootelement Could you kindly advice - I think in order to support v5 challenge ids, we would need to create a new index, update the data type for challengeId to string, copy the data over to the new index and drop the old index.
OR
We could (Could we) create a new attribute for the v5 challenge id?

@callmekatootie
Copy link
Contributor

@sushilshinde This could take some time depending on the approach that we will take. The fix is not straightforward and thus an ETA would be difficult to provide.

callmekatootie added a commit that referenced this issue Jun 25, 2020
@cwdcwd
Copy link
Contributor

cwdcwd commented Jun 25, 2020

@callmekatootie couldn't we just set up a new index, update the document model to a string and then run this loading script against it ?

@callmekatootie
Copy link
Contributor

Yes, we could use that loading script as well.

So is it confirmed that we move ahead with creation of a new index?

@rootelement
Copy link
Contributor

@callmekatootie yes, please do that

@rootelement
Copy link
Contributor

@callmekatootie what do you want the index to be? I can create it in dev and prod, then when the type is updated, we can just run that script.

@callmekatootie
Copy link
Contributor

How does submission-index-v2 sound? You need to set it in the ES_INDEX_NEW environment variable

@callmekatootie
Copy link
Contributor

FYI - current value is submission-index

@callmekatootie
Copy link
Contributor

Perhaps I name the environment variable as ES_INDEX_V2 as well? 🤔

@callmekatootie
Copy link
Contributor

callmekatootie commented Jun 28, 2020

@rootelement So current status:

Pull Request with the changes: #184

Let me know if I can proceed to merge with develop. After which, you need to:

  • Create the new index.
  • The name of the newly created index needs to be set in the ES_INDEX_V2 environment variable
  • You will then run the script npm run create-new-index which will copy the mappings from the old index to the new one, while updating the data type of challengeId to be keyword from long.
  • Next, you will run the script npm run db-to-es which will copy the data from the dynamodb database into the newly created index
  • Let me know once this is done. I will then proceed to correct the code to read from the new index instead of the old one

@rootelement
Copy link
Contributor

Amazon Elasticsearch Service creates an index around the first document you add. This makes it possible to put a document into an index without knowing whether it exists.

I don't see any option to create a new index, so we should just change the name and try it.

I've added "ES_INDEX_V2": "submission-index-v2", to both the submission-api and the submission-processor-es config vars in dev. I tried checking out the Issue_179 branch and running the script, but the error below. I set up the env file the same way I launch npm scripts for challenge api, and the ES tunnel through the vpn, so that shouldn't be the error. Let me know what i should do. You can merge that to develop and i can try again when it's there.

[[email protected] ~/repo/topcoder/submissions-api]$ nf run npm run create-new-index
[OKAY] Loaded ENV .env File as JSON Format

> [email protected] create-new-index /Users/jamescori/repo/topcoder/submissions-api
> node scripts/createNewIndex.js

info: ES Index creation started!
error: { Bad Request :: {"path":"/submission-index","query":{},"statusCode":400,"response":"<html>\r\n<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>400 Bad Request</h1></center>\r\n<center>The plain HTTP request was sent to HTTPS port</center>\r\n</body>\r\n</html>\r\n"}
    at respond (/Users/jamescori/repo/topcoder/submissions-api/node_modules/elasticsearch/src/lib/transport.js:308:15)
    at checkRespForFailure (/Users/jamescori/repo/topcoder/submissions-api/node_modules/elasticsearch/src/lib/transport.js:267:7)
    at HttpConnector.<anonymous> (/Users/jamescori/repo/topcoder/submissions-api/node_modules/elasticsearch/src/lib/connectors/http.js:166:7)
    at IncomingMessage.wrapper (/Users/jamescori/repo/topcoder/submissions-api/node_modules/lodash/lodash.js:4929:19)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)
From previous event:
    at Transport.defer (/Users/jamescori/repo/topcoder/submissions-api/node_modules/elasticsearch/src/lib/transport.js:124:19)
    at Transport.request (/Users/jamescori/repo/topcoder/submissions-api/node_modules/elasticsearch/src/lib/transport.js:177:18)
    at exec (/Users/jamescori/repo/topcoder/submissions-api/node_modules/elasticsearch/src/lib/client_action.js:362:20)
    at ClientNamespace.action [as get] (/Users/jamescori/repo/topcoder/submissions-api/node_modules/elasticsearch/src/lib/client_action.js:62:16)
    at createIndex (/Users/jamescori/repo/topcoder/submissions-api/scripts/createNewIndex.js:14:42)
    at createIndex.next (<anonymous>)
    at onFulfilled (/Users/jamescori/repo/topcoder/submissions-api/node_modules/co/index.js:65:19)
    at /Users/jamescori/repo/topcoder/submissions-api/node_modules/co/index.js:54:5
From previous event:
    at co (/Users/jamescori/repo/topcoder/submissions-api/node_modules/co/index.js:50:10)
    at Object.<anonymous> (/Users/jamescori/repo/topcoder/submissions-api/scripts/createNewIndex.js:11:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
  status: 400,
  displayName: 'BadRequest',
  message: 'Bad Request',
  path: '/submission-index',
  query: {},
  body: '<html>\r\n<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>\r\n<body bgcolor="white">\r\n<center><h1>400 Bad Request</h1></center>\r\n<center>The plain HTTP request was sent to HTTPS port</center>\r\n</body>\r\n</html>\r\n',
  statusCode: 400,
  response: '<html>\r\n<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>\r\n<body bgcolor="white">\r\n<center><h1>400 Bad Request</h1></center>\r\n<center>The plain HTTP request was sent to HTTPS port</center>\r\n</body>\r\n</html>\r\n',
  toString: [Function],
  toJSON: [Function] }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] create-new-index: `node scripts/createNewIndex.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] create-new-index script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jamescori/.npm/_logs/2020-06-28T17_35_52_287Z-debug.log

@rootelement
Copy link
Contributor

@callmekatootie slack me directly if you want to work on this

@callmekatootie
Copy link
Contributor

@rootelement The error says:

The plain HTTP request was sent to HTTPS port

What is your ES endpoint url look like... is it in http perhaps?

callmekatootie added a commit that referenced this issue Jun 29, 2020
#179 Update data type for challengeId in the index, by creating a new index
callmekatootie added a commit that referenced this issue Jun 29, 2020
callmekatootie added a commit to topcoder-platform/submission-processor-es that referenced this issue Jun 29, 2020
@rootelement
Copy link
Contributor

@luizrrodrigues this is fixed in dev. Please test there. We're scheduling the hotfix to deploy to prod hopefully tomorrow

@callmekatootie
Copy link
Contributor

@callmekatootie @sushilshinde , this would require the FE to query the submissions api using both the legacy id and the new UUID for a challenge to get all the submissions for the challenge right ?

That is right. They would need to use the same id (legacy or v5) that was used during submission creation. But you can let me know the expectations here.

@SathyaJayabal
Copy link
Collaborator

@callmekatootie @sushilshinde , this would require the FE to query the submissions api using both the legacy id and the new UUID for a challenge to get all the submissions for the challenge right ?

That is right. They would need to use the same id (legacy or v5) that was used during submission creation. But you can let me know the expectations here.

Sure. Let us get back to you.

@rootelement
Copy link
Contributor

@SathyaJayabal , this shouldn't be an issue, because going forward after this release, everything should be working in UUIDs. So if the submission was created, it will have a UUID, and if we're retrieving old data, the system will look up the submission by that UUID and convert it to legacyId on the backend to get any related data. The only gray area will be if a submission was created in testing before this change and a legacyId was used, and now you're referring to the same submission by a UUID.

@rootelement
Copy link
Contributor

@SathyaJayabal We're discussing if there's an easier option. Give us about an hour to decide

callmekatootie added a commit that referenced this issue Jun 30, 2020
* #179 - Support v5 challenge ids but ensure that we store legacy in db

* Fix test
@rootelement
Copy link
Contributor

@luizrrodrigues

Also if check challenge details, return numOfSubmissions and numOfRegistrants equals ZERO:
https://api.topcoder-dev.com/v5/challenges/8cabd850-7d44-4036-a5a1-90d38b7f7733

This has numbers now. I think this was originally part of the sync issue. These numbers should be updated by the challenge-processor-es when a submission is created or a user registers. When i click that link, i see numbers in registrants and submissions. Please confirm this is still an issue.

cc: @callmekatootie

@callmekatootie
Copy link
Contributor

@luizrrodrigues The other issues that you have reported are now resolved. Could you kindly verify at your end and let me know if you still face any issues.

@sushilshinde @SathyaJayabal You can now pass either v5 or legacy challenge id for your queries. Submission API will convert the v5 challenge id to legacy and respond accordingly. The FE should now be able to work with both.

@luizrrodrigues
Copy link
Author

@callmekatootie @rootelement cool, thanks.
I'll always use UUID in FE, when trying access with legacyId in URL, FE will call challenge details first to get UUID and then make other calls with UUID.

I'll check shortly and report here.

@rootelement
Copy link
Contributor

Ok, we're updating to store the legacyId in the db. So if you pass in the uuid, it's translated, if you pass in the legacyId, it's used. @callmekatootie has pushed to dev and his tests pass. You should be able to use either.

@luizrrodrigues
Copy link
Author

@rootelement @callmekatootie

It looks like not working well.

Tests:

  1. Challenge Id: 68a1cb52-a313-4130-8900-87a21959fdae
  • Able to submit and receive the return:
    POST https://api.topcoder-dev.com/v5/submissions/
{
    "id": "64d3c934-f6c0-4a9b-bd22-d32d5389e3d2",
    "type": "Contest Submission",
    "url": "https://s3.amazonaws.com/topcoder-dev-submissions-dmz/68a1cb52-a313-4130-8900-87a21959fdae-40152905-SUBMISSION_ZIP-1593568639028.zip",
    "memberId": 40152905,
    "challengeId": 30056664,
    "created": "2020-07-01T01:57:47.313Z",
    "updated": "2020-07-01T01:57:47.313Z",
    "createdBy": "dan_developer",
    "updatedBy": "dan_developer",
    "submissionPhaseId": "bd96ba1c-29e2-4ee9-b437-7ca0b8ee3422",
    "fileType": "zip"
}
  • But if request the submission to challenge this new submission not present:
    GET https://api.topcoder-dev.com/v5/submissions?challengeId=68a1cb52-a313-4130-8900-87a21959fdae
[
    {
        "updatedBy": "dan_developer",
        "created": "2020-05-15T12:25:32.766Z",
        "legacySubmissionId": 209333,
        "isFileSubmission": false,
        "type": "Contest Submission",
        "url": "https://s3.amazonaws.com/topcoder-dev-submissions/b54a6cfd-f9f8-4963-bed6-122dec447761.zip",
        "challengeId": 30056664,
        "createdBy": "dan_developer",
        "review": [
            {
                "score": 100,
                "updatedBy": "MeaSS8yPG4VIer4XalVqOAYhnCNecGfN@clients",
                "reviewerId": "bfe36d28-2e39-493e-bbd4-897c4bf0c8b6",
                "submissionId": "b54a6cfd-f9f8-4963-bed6-122dec447761",
                "createdBy": "MeaSS8yPG4VIer4XalVqOAYhnCNecGfN@clients",
                "created": "2020-05-15T12:25:44.137Z",
                "scoreCardId": 150037724,
                "typeId": "d96d5f17-5884-47b8-bfea-bddf066e451f",
                "id": "f01cf9f5-7545-48e3-adf8-0a4e60c790fe",
                "updated": "2020-05-15T12:25:44.137Z",
                "status": "completed"
            },
            {
                "score": 100,
                "updatedBy": "maE2maBSv9fRVHjSlC31LFZSq6VhhZqC@clients",
                "reviewerId": "d7ac8284-9b9b-43ac-9bf6-3b2dc9f3dbe6",
                "submissionId": "b54a6cfd-f9f8-4963-bed6-122dec447761",
                "createdBy": "maE2maBSv9fRVHjSlC31LFZSq6VhhZqC@clients",
                "created": "2020-05-15T12:25:36.093Z",
                "scoreCardId": 30001850,
                "typeId": "68c5a381-c8ab-48af-92a7-7a869a4ee6c3",
                "id": "296667c3-a863-4261-9476-d09f1dbaf914",
                "updated": "2020-05-15T12:25:36.093Z",
                "status": "completed"
            }
        ],
        "id": "b54a6cfd-f9f8-4963-bed6-122dec447761",
        "submissionPhaseId": 775112,
        "updated": "2020-05-15T12:25:32.766Z",
        "fileType": "zip",
        "memberId": 40152905
    },
    {
        "updatedBy": "TonyJ",
        "created": "2020-05-15T10:34:31.532Z",
        "legacySubmissionId": 209330,
        "isFileSubmission": false,
        "type": "Contest Submission",
        "url": "https://s3.amazonaws.com/topcoder-dev-submissions/ef7b075b-bf6a-4ffb-9086-b08d250c2f37.zip",
        "challengeId": 30056664,
        "createdBy": "TonyJ",
        "review": [
            {
                "score": 100,
                "updatedBy": "MeaSS8yPG4VIer4XalVqOAYhnCNecGfN@clients",
                "reviewerId": "8f002120-d650-4d7d-be03-6c21efee66b0",
                "submissionId": "ef7b075b-bf6a-4ffb-9086-b08d250c2f37",
                "createdBy": "MeaSS8yPG4VIer4XalVqOAYhnCNecGfN@clients",
                "created": "2020-05-15T10:34:43.110Z",
                "scoreCardId": 23602221,
                "typeId": "d96d5f17-5884-47b8-bfea-bddf066e451f",
                "id": "57bf5fca-8bf1-49f7-b1e9-182b858705b3",
                "updated": "2020-05-15T10:34:43.110Z",
                "status": "completed"
            },
            {
                "score": 100,
                "updatedBy": "maE2maBSv9fRVHjSlC31LFZSq6VhhZqC@clients",
                "reviewerId": "1f8cdae7-9fc1-4b86-9528-d3a29568305f",
                "submissionId": "ef7b075b-bf6a-4ffb-9086-b08d250c2f37",
                "createdBy": "maE2maBSv9fRVHjSlC31LFZSq6VhhZqC@clients",
                "created": "2020-05-15T10:34:34.739Z",
                "scoreCardId": 30001850,
                "typeId": "68c5a381-c8ab-48af-92a7-7a869a4ee6c3",
                "id": "e8b35ae1-1eb8-4241-8e11-a99e0451b7be",
                "updated": "2020-05-15T10:34:34.739Z",
                "status": "completed"
            }
        ],
        "id": "ef7b075b-bf6a-4ffb-9086-b08d250c2f37",
        "submissionPhaseId": 775112,
        "updated": "2020-05-15T10:34:31.532Z",
        "fileType": "zip",
        "memberId": 8547899
    }
]

  1. Challenge Id: ce7c03ff-ccd1-4c8a-b02f-a6a8dc27739f
  • Able to submit and receive the return:
    POST https://api.topcoder-dev.com/v5/submissions/
{
    "id": "b63d88bb-bb4b-4333-ba01-7c0cce2fc4aa",
    "type": "Contest Submission",
    "url": "https://s3.amazonaws.com/topcoder-dev-submissions-dmz/ce7c03ff-ccd1-4c8a-b02f-a6a8dc27739f-40152905-SUBMISSION_ZIP-1593569314304.zip",
    "memberId": 40152905,
    "challengeId": 30056662,
    "created": "2020-07-01T02:09:15.021Z",
    "updated": "2020-07-01T02:09:15.021Z",
    "createdBy": "dan_developer",
    "updatedBy": "dan_developer",
    "submissionPhaseId": "ae38efe8-680e-446f-83f9-184153b57097",
    "fileType": "zip"
}
  • But if request submissions from the challenge, missing this new submission:
    https://api.topcoder-dev.com/v5/submissions?challengeId=ce7c03ff-ccd1-4c8a-b02f-a6a8dc27739f
[
    {
        "updatedBy": "lakshmiathreya",
        "created": "2020-05-15T10:29:38.748Z",
        "legacySubmissionId": 209309,
        "isFileSubmission": false,
        "type": "Contest Submission",
        "url": "https://s3.amazonaws.com/topcoder-dev-submissions/7f13af9c-b700-47c7-bd1b-646c050a9f3f.zip",
        "challengeId": 30056662,
        "createdBy": "lakshmiathreya",
        "review": [
            {
                "score": 100,
                "updatedBy": "MeaSS8yPG4VIer4XalVqOAYhnCNecGfN@clients",
                "reviewerId": "d4a31da4-643f-4833-811a-ecdf7cc1e006",
                "submissionId": "7f13af9c-b700-47c7-bd1b-646c050a9f3f",
                "createdBy": "MeaSS8yPG4VIer4XalVqOAYhnCNecGfN@clients",
                "created": "2020-05-15T10:29:48.224Z",
                "scoreCardId": 166984016,
                "typeId": "d96d5f17-5884-47b8-bfea-bddf066e451f",
                "id": "aed3200d-561e-4b07-9f1c-32b7e9e1672a",
                "updated": "2020-05-15T10:29:48.224Z",
                "status": "completed"
            },
            {
                "score": 100,
                "updatedBy": "maE2maBSv9fRVHjSlC31LFZSq6VhhZqC@clients",
                "reviewerId": "889482b1-428b-4668-98e6-cc2b7db957a5",
                "submissionId": "7f13af9c-b700-47c7-bd1b-646c050a9f3f",
                "createdBy": "maE2maBSv9fRVHjSlC31LFZSq6VhhZqC@clients",
                "created": "2020-05-15T10:29:41.963Z",
                "scoreCardId": 30001850,
                "typeId": "68c5a381-c8ab-48af-92a7-7a869a4ee6c3",
                "id": "76f84016-7b76-4cdb-a57a-3b5ba5fb797d",
                "updated": "2020-05-15T10:29:41.963Z",
                "status": "completed"
            }
        ],
        "id": "7f13af9c-b700-47c7-bd1b-646c050a9f3f",
        "submissionPhaseId": 775094,
        "updated": "2020-05-15T10:29:38.748Z",
        "fileType": "zip",
        "memberId": 40158331
    }
]

@rootelement
Copy link
Contributor

@luizrrodrigues when you upload a submission, don't pass submissionPhaseId - according to this code, it will get looked up if it's not passed:
https://github.com/topcoder-platform/submissions-api/blob/develop/src/services/SubmissionService.js#L376
Please try this test again.

@rootelement
Copy link
Contributor

rootelement commented Jul 1, 2020

It's storing a v5 uuid on the object, but the ES processor is looking up that v5 uuid in v4 and not finding it.

cc: @callmekatootie

The error from the submission-processor-es:


2020-06-30T22:09:16.937-04:00 | { resource: 'submission',
  | 2020-06-30T22:09:16.937-04:00 | id: 'b63d88bb-bb4b-4333-ba01-7c0cce2fc4aa',
  | 2020-06-30T22:09:16.937-04:00 | type: 'Contest Submission',
  | 2020-06-30T22:09:16.937-04:00 | url: 'https://s3.amazonaws.com/topcoder-dev-submissions-dmz/ce7c03ff-ccd1-4c8a-b02f-a6a8dc27739f-40152905-SUBMISSION_ZIP-1593569314304.zip',
  | 2020-06-30T22:09:16.937-04:00 | memberId: 40152905,
  | 2020-06-30T22:09:16.937-04:00 | challengeId: 30056662,
  | 2020-06-30T22:09:16.937-04:00 | created: '2020-07-01T02:09:15.021Z',
  | 2020-06-30T22:09:16.937-04:00 | updated: '2020-07-01T02:09:15.021Z',
  | 2020-06-30T22:09:16.937-04:00 | createdBy: 'dan_developer',
  | 2020-06-30T22:09:16.937-04:00 | updatedBy: 'dan_developer',
  | 2020-06-30T22:09:16.937-04:00 | submissionPhaseId: 'ae38efe8-680e-446f-83f9-184153b57097',
  | 2020-06-30T22:09:16.937-04:00 | fileType: 'zip',
  | 2020-06-30T22:09:16.937-04:00 | isFileSubmission: false } } }

  | 2020-06-30T22:09:16.969-04:00 | error: { [mapper_parsing_exception] failed to parse [submissionPhaseId] :: 
{
   "path":"/submission-index/submission/b63d88bb-bb4b-4333-ba01-7c0cce2fc4aa/_create",
   "query":{

   },
   "body":"{\"resource\":\"submission\",\"id\":\"b63d88bb-bb4b-4333-ba01-7c0cce2fc4aa\",\"type\":\"Contest Submission\",\"url\":\"https://s3.amazonaws.com/topcoder-dev-submissions-dmz/ce7c03ff-ccd1-4c8a-b02f-a6a8dc27739f-40152905-SUBMISSION_ZIP-1593569314304.zip\",\"memberId\":40152905,\"challengeId\":30056662,\"created\":\"2020-07-01T02:09:15.021Z\",\"updated\":\"2020-07-01T02:09:15.021Z\",\"createdBy\":\"dan_developer\",\"updatedBy\":\"dan_developer\",\"submissionPhaseId\":\"ae38efe8-680e-446f-83f9-184153b57097\",\"fileType\":\"zip\",\"isFileSubmission\":false}",
   "statusCode":400,
   "response":"{\"error\":{\"root_cause\":[{\"type\":\"mapper_parsing_exception\",\"reason\":\"failed to parse [submissionPhaseId]\"}],\"type\":\"mapper_parsing_exception\",\"reason\":\"failed to parse [submissionPhaseId]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"For input string: \\\"ae38efe8-680e-446f-83f9-184153b57097\\\"\"}},\"status\":400}"
}

@callmekatootie
Copy link
Contributor

From the ES index:

          "submissionPhaseId": {
            "type": "long"
          }

So, if you are passing, it needs to be a number or do not pass it - and the api will retrieve it. I am guessing the new submission phase id is uuid. I will update the validation in the api to NOT accept uuids for submission phase id but do let me know if this is needed.

@luizrrodrigues
Copy link
Author

@callmekatootie Yes, only have UUID in phases.

So if don't pass submissionPhaseId will work or need to retrieve legacyId from phase in FE?

@callmekatootie
Copy link
Contributor

You don't have to pass it - submission api will retrieve it, based on the challenge id.

@luizrrodrigues
Copy link
Author

Okay, cool. I'll update and test.

@luizrrodrigues
Copy link
Author

@callmekatootie @rootelement Cool, looks good now.

@SathyaJayabal
Copy link
Collaborator

SathyaJayabal commented Jul 6, 2020

@callmekatootie, after this fix, I was able to verify the following on beta(prod backend)

  1. Submissions made from V5 visible on submissions tab in challenge details
  2. The submissions made from V5 was visible in Online review
  3. Submission confirmation email was received on submission

But I was not able to verify the 2 and 3 in test env(dev backend)
Submissions made from V5 were seen in the submissions tab, but not reflecting in OR and no email confirmation.

Do you have any idea, why there is a difference between the two envs?

@callmekatootie
Copy link
Contributor

@SathyaJayabal I am afraid not. I don't expect the issue to be with submission api - it could be with the dev instances of Online Review and the Email processor. If there's any additional information that you could provide (say - an example request that is failing in dev instance) I could look into it further

@SathyaJayabal
Copy link
Collaborator

@callmekatootie, thanks. Like you said the issue could be with the dev instances of the OR or submissions or email processor.

@callmekatootie
Copy link
Contributor

Parent ticket (topcoder-platform/community-app#4586) closed and thus closing this ticket too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants