Skip to content
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

[BUG] Challonge Integration - Match fails loading with TypeError: Cannot read property 'toUpperCase' of null #208

Closed
JesusWithPants opened this issue Jun 27, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@JesusWithPants
Copy link

JesusWithPants commented Jun 27, 2022

Describe the bug
Season/Team works as expected, however when loading imported teams/season into a match, it always fails with "TypeError: Cannot read property 'toUpperCase' of null"

To Reproduce
Steps to reproduce the behavior:
1.Create Challonge tournament (you can use one of mine, IDs: pxfqujhq and xarm1e09
2. Import Season and Teams
3. Add players to teams
4. Start a match w/ season and teams
5. Output as explained above

Screenshots
image
G5VAPI Logs:

0|G5API  | ::ffff:172.30.0.5 - - [27/Jun/2022:16:44:39 +0000] "POST /matches/ HTTP/1.1" 200 50 "https://get5.example.com/match/create" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0"

0|G5API  | TypeError: Cannot read property 'toUpperCase' of null

0|G5API  |     at build_team_dict (file:///Get5API/G5API/routes/matches/matches.js:1262:21)

0|G5API  |     at processTicksAndRejections (node:internal/process/task_queues:96:5)

0|G5API  |     at async file:///Get5API/G5API/routes/matches/matches.js:701:7

0|G5API  | GET /matches/69/config 500 14.629 ms - 67

0|G5API  | ::ffff:172.30.0.5 - - [27/Jun/2022:16:44:39 +0000] "GET /matches/69/config HTTP/1.1" 500 67 "-" "Valve/Steam HTTP Client 1.0 (730)"

0|G5API  | GET /matches/69 200 4.894 ms - 700

0|G5API  | ::ffff:172.30.0.5 - - [27/Jun/2022:16:44:40 +0000] "GET /matches/69 HTTP/1.1" 200 700 "https://get5.example.com/match/69" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0"

CSGO Server Logs:

Jun 27 16:44:38:  L 06/27/2022 - 16:44:38: rcon from "80.209.225.34:56512": command "get5_web_available"
Jun 27 16:44:38:  Match config loading initialized.
Jun 27 16:44:38:  L 06/27/2022 - 16:44:38: rcon from "80.209.225.34:56514": command "get5_loadmatch_url "https://get5.example.com/api/matches/69/config""
Jun 27 16:44:38:  L 06/27/2022 - 16:44:38: rcon from "80.209.225.34:56516": command "get5_web_api_key KEY"
Jun 27 16:44:38:  L 06/27/2022 - 16:44:38: [get5.smx] Failed to load match config: Missing "team1" section in match json
Jun 27 16:44:38:  L 06/27/2022 - 16:44:38: get5_event: {
Jun 27 16:44:38:      "matchid": "matchid",
Jun 27 16:44:38:      "params": {
Jun 27 16:44:38:          "reason": "Missing \"team1\" section in match json"
Jun 27 16:44:38:      },
Jun 27 16:44:38:      "event": "match_config_load_fail"
Jun 27 16:44:38:  }

Contents sent to CSGO server:

{
    "message": "TypeError: Cannot read property 'toUpperCase' of null"
}

Server info
DatHost instance

Docker Information
Using public docker files (pulled from your repos) (:latest)

@JesusWithPants JesusWithPants added the triage Potential Bugs - Remove if confirmed label Jun 27, 2022
@JesusWithPants
Copy link
Author

And it so happens that when I post it, I figure out the solution - For Imported teams - if you do not provide a country flag - it will fail via behavior explained above. (Works w/o adding country flags for manually created seasons+teams+matches)

@PhlexPlexico
Copy link
Owner

Hmmm interesting. Could you take a look at the database and check to see if the flag column for those imported teams is NULL or just blank? And then one from a manually created team with no flag?

Thanks!

@PhlexPlexico
Copy link
Owner

Ah, latest commit fixes this, looks like I wasn't checking the flag value to see if there was any data. The database technically accepts blank values which is what the front end does, but not NULL. This should be fixed if you pull from master, thanks for all the log files and everything btw, super helpful in tracking this down :)

@PhlexPlexico PhlexPlexico added bug Something isn't working and removed triage Potential Bugs - Remove if confirmed labels Jun 27, 2022
@JesusWithPants
Copy link
Author

Hey, thanks. Will see if I can build from latest commit anytime soon and test it out.
Any ETA when this will be pushed as public-build?

@PhlexPlexico
Copy link
Owner

Should be built now! It's all done via actions whenever there's a commit to the main branch - https://github.com/PhlexPlexico/G5API/actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants