marcoblume / pinnacle.API

R Wrapper for the Pinnacle API
40 stars 13 forks source link

showOddsDF() error #33

Closed tiagoafonso85 closed 6 years ago

tiagoafonso85 commented 6 years ago

Hello shapenaji, I put this error in the continuation of the issue "Error in Vapply ()", but I do not know if it was seen. Otherwise, you can close the other issue.

I'm back with my bot. So I have not changed the code since the last bug I reported here, and I have not run my code since then either. I have pinnacle 2.3.3

I was running line by line of my code to see if at any point I found any error related to my code and no line of code resulted in any errors.

Basically my code boils down to:

bag the games that are currently being played with:

while(NROW(leagues_games1$sports_leagues.id)) == 0) { Sys.sleep (5) leagues_games1 <<- GetInrunning() }

remove NA's from leagues_games1

and then, use:

Soccer_Data_isLive_X <- showOddsDF(sportid = 29, leagueids = leagues_games1$sports.leagues.id, attachLeagueInfo = TRUE, tableformat = 'long', oddsformat = 'DECIMAL', islive = 1)

To collect the odds of the games being played.

So, I put my code running...

2018-03-25 23: 44: 55 | Pulling Inrunning (Live) State 2018-03-25 23:44:56| Pulling Odds for - sportid: 29 leagueids: 72425, 72425, 10769, 6820, 6820, 6820, 5598, 10776, 198060, 5596, 197248, 5593, 10768, 1739, 1739, 1739, 196742, 196742, 5591, 5591, 198494, 9591, 5595, 196865, 196865, 196865, 2359, 6668, 198062 islive: 1 oddsformat: DECIMAL tableformat: long 2018-03-25 23:44:57| Pulling Fixtures for Sport ID: 29, with League ID(s): 72425, 72425, 10769, 6820, 6820, 6820, 5598, 10776, 198060, 5596, 197248, 5593, 10768, 1739, 1739, 1739, 196742, 196742, 5591, 5591, 198494, 9591, 5595, 196865, 196865, 196865, 2359, 6668, 198062 2018-03-25 23:44:57| Pulling Inrunning (Live) State 2018-03-25 23:44:57| Pulling new league ids for sportid: 29 2018-03-25 23:45:03| Pulling Inrunning (Live) State 2018-03-25 23:45:03| Pulling Odds for - sportid: 29 leagueids: 72425, 72425, 10769, 6820, 6820, 6820, 5598, 10776, 198060, 5596, 197248, 5593, 10768, 1739, 1739, 1739, 196742, 196742, 5591, 5591, 198494, 9591, 5595, 196865, 196865, 196865, 2359, 6668, 198062 since: 486944773 islive: 1 oddsformat: DECIMAL tableformat: long 2018-03-25 23:45:04| Pulling Fixtures for Sport ID: 29, with League ID(s): 72425, 72425, 10769, 6820, 6820, 6820, 5598, 10776, 198060, 5596, 197248, 5593, 10768, 1739, 1739, 1739, 196742, 196742, 5591, 5591, 198494, 9591, 5595, 196865, 196865, 196865, 2359, 6668, 198062 2018-03-25 23:45:04| Pulling Inrunning (Live) State 2018-03-25 23:45:04| Pulling new league ids for sportid: 29 2018-03-25 23:45:10| Pulling Inrunning (Live) State 2018-03-25 23:45:10| Pulling Odds for - sportid: 29 leagueids: 72425, 72425, 10769, 6820, 6820, 6820, 5598, 10776, 198060, 5596, 197248, 5593, 10768, 1739, 1739, 1739, 196742, 196742, 5591, 5591, 198494, 9591, 5595, 196865, 196865, 196865, 2359, 6668, 198062 since: 486944830 islive: 1 oddsformat: DECIMAL tableformat: long ... ... ...

and ended 12 hours later with:

2018-03-26 11: 41: 19 | Pulling Inrunning (Live) State 2018-03-26 11: 41: 19 | Pulling Odds for - sportid: 29 leagueids: 2116, 1753, 198572 islive: 1 oddsformat: DECIMAL tableformat: long 2018-03-26 11: 41: 19 | Pulling Fixtures for Sport ID: 29, with League ID (s): 2116, 1753, 198572 2018-03-26 11: 41: 20 | Pulling Inrunning (Live) State 2018-03-26 11: 41: 20 | Pulling new league ids for sportid: 29 2018-03-26 11: 41: 25 | Pulling Inrunning (Live) State 2018-03-26 11: 41: 25 | Pulling Odds for - sportid: 29 leagueids: 2116 since: 487003396 islive: 1 oddsformat: DECIMAL tableformat: long No odds for the given selections. 2018-03-26 11: 41: 31 | Pulling Inrunning (Live) State 2018-03-26 11: 41: 31 | Pulling Odds for - sportid: 29 leagueids: 2116 islive: 1 oddsformat: DECIMAL tableformat: long 2018-03-26 11: 41: 31 | Pulling Fixtures for Sport ID: 29, with League ID (s): 2116 2018-03-26 11: 41: 31 | Pulling Inrunning (Live) State 2018-03-26 11: 41: 32 | Pulling new league ids for sportid: 29 2018-03-26 11: 41: 37 | Pulling Inrunning (Live) State 2018-03-26 11: 41: 37 | Pulling Odds for - sportid: 29 leagueids: 2116 since: 487003284 islive: 1 oddsformat: DECIMAL tableformat: long No odds for the given selections. 2018-03-26 11: 41: 43 | Pulling Inrunning (Live) State 2018-03-26 11: 41: 43 | Pulling Odds for - sportid: 29 leagueids: 2116 islive: 1 oddsformat: DECIMAL tableformat: long 2018-03-26 11: 41: 43 | Pulling Fixtures for Sport ID: 29, with League ID (s): 2116 2018-03-26 11: 41: 43 | Pulling Inrunning (Live) State 2018-03-26 11: 41: 44 | Pulling new league ids for sportid: 29 2018-03-26 11: 41: 49 | Pulling Inrunning (Live) State 2018-03-26 11: 41: 49 | Pulling Odds for - sportid: 29 leagueids: 2116 since: 487003284 islive: 1 oddsformat: DECIMAL tableformat: long No odds for the given selections. 2018-03-26 11: 41: 54 | Pulling Inrunning (Live) State 2018-03-26 11: 41: 55 | Pulling Odds for - sportid: 29 leagueids: 2116 islive: 1 oddsformat: DECIMAL tableformat: long 2018-03-26 11: 41: 55 | Pulling Fixtures for Sport ID: 29, with League ID (s): 2116 2018-03-26 11: 41: 55 | Pulling Inrunning (Live) State 2018-03-26 11: 41: 55 | Pulling new league ids for sportid: 29 2018-03-26 11: 42: 01 | Pulling Inrunning (Live) State 2018-03-26 11: 42: 01 | Pulling Odds for - sportid: 29 leagueids: 2116 since: 487003566 islive: 1 oddsformat: DECIMAL tableformat: long No odds for the given selections. 2018-03-26 11: 42: 06 | Pulling Inrunning (Live) State 2018-03-26 11: 42: 06 | Pulling Odds for - sportid: 29 leagueids: 2116 islive: 1 oddsformat: DECIMAL tableformat: long 2018-03-26 11: 42: 07 | Pulling Fixtures for Sport ID: 29, with League ID (s): 2116 2018-03-26 11: 42: 07 | Pulling Inrunning (Live) State 2018-03-26 11: 42: 07 | Pulling new league ids for sportid: 29 2018-03-26 11: 42: 13 | Pulling Inrunning (Live) State 2018-03-26 11: 42: 13 | Pulling Odds for - sportid: 29 leagueids: 2116, 1753, 198572 since: 487003284 islive: 1 oddsformat: DECIMAL tableformat: long 2018-03-26 11: 42: 13 | Pulling Fixtures for Sport ID: 29, with League ID (s): 2116, 1753, 198572 2018-03-26 11: 42: 13 | Pulling Inrunning (Live) State 2018-03-26 11: 42: 14 | Pulling new league ids for sportid: 29 2018-03-26 11: 42: 19 | Pulling Inrunning (Live) State 2018-03-26 11: 42: 19 | Pulling Odds for - sportid: 29 leagueids: 2116, 1753, 198572 since: 487003589 islive: 1 oddsformat: DECIMAL tableformat: long 2018-03-26 11: 42: 20 | Pulling Fixtures for Sport ID: 29, with League ID (s): 2116, 1753, 198572 2018-03-26 11: 42: 20 | Pulling Inrunning (Live) State 2018-03-26 11: 42: 20 | Pulling new league ids for sportid: Error in merge.data.table (out, leagueinfo, by.x = "league.id", by.y = "leagues.id",: Elements listed in by.y must be valid column names in and.

save (Soccer_Data_isLive, file = file)

system ("ping -c 5 google.com")
PING google.com (216.58.214.174) 56 (84) bytes of data.
64 bytes from mad01s26-in-f174.1e100.net (216.58.214.174): icmp_seq = 1 ttl = 56 time = 26.2 ms
64 bytes from mad01s26-in-f174.1e100.net (216.58.214.174): icmp_seq = 2 ttl = 56 time = 22.3 ms
64 bytes from mad01s26-in-f174.1e100.net (216.58.214.174): icmp_seq = 3 ttl = 56 time = 22.6 ms
64 bytes from mad01s26-in-f174.1e100.net (216.58.214.174): icmp_seq = 4 ttl = 56 time = 22.3 ms
64 bytes from mad01s26-in-f174.1e100.net (216.58.214.174): icmp_seq = 5 ttl = 56 time = 22.8 ms

--- google.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4004ms rtt min/avg/max/mdev = 22.305/23.275/26.217/1.485 ms

what you think it happened?

Thanks in advance

shapenaji commented 6 years ago

Looks like one of the 4 calls that make up showOddsDF is either returning no data or different than expected data. I'll make a note and see if we can harden this a bit.

In the meantime I would recommend adding a try catch statement on that, that will just run again in case of failure.

tiagoafonso85 commented 6 years ago

ok, Thanks. I will do like the exemple you sayd in a past post of a try statement.

shapenaji commented 6 years ago

Closing, this collection of issues appears to be network related