Halite Home

Error Undefined index: userID on upload


#1

Hi there,

I got hold of the ruby starter package and submitted my first bot. I get a timeout error and the log contains the following:

<br />
<b>Notice</b>:  Undefined index: userID in <b>/home/ubuntu/Halite/website/api/web/WebsiteAPI.php</b> on line <b>411</b><br />
<br />
<b>Warning</b>:  mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in <b>/home/ubuntu/Halite/website/api/API.class.php</b> on line <b>51</b><br />
null

This looks suspiciously like an external error, at least I don't see any relevance to the ruby bot code.
How to fix this? Anything I can do?

Thanks in advance,

Wim.


#2

Update: Whatever the problem was, it disappeared on my subsequent uploads. So it looks like a transient thing.
Now I've got just my own bugs to contend with. :grin:


#3

Great! That was a result of a short-lived bug that was fixed a day ago.


#4

Your bot seems to be doing pretty well!


#5

This is to notify that the exact same error just occurred again during a game. This after my last bot played over 200 games without any problem. I'm not sure what further to report. Is a link to the error log useful?

Here it is: Error log


#6

That error log is private to your account. Only you will download the log when clicking on that link. This is because stderr and stdout may reveal details about your bot's code.

Could you post the contents instead?


#7

I am getting the same error as OP in most of my matches in last half hour. Here is original report:

https://2016.halite.io/game.php?replay=ar1479579140-1562023349.hlt
https://2016.halite.io/api/web/errorLog?errorLogName=3-1479579140.log


#8

Specifically:

> <br />
> <b>Notice</b>:  Undefined index: userID in <b>/home/ubuntu/Halite/website/api/web/WebsiteAPI.php</b> on line <b>452</b><br />
> <br />
> <b>Warning</b>:  mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in <b>/home/ubuntu/Halite/website/api/API.class.php</b> on line <b>51</b><br />
> null

#9

Believe that this should now fixed.


#10

Ah OK, I didn't know that. TIL.


#11

As in, it resurfaced as a side effect of another bug, and we patched it. Didn't mean your bug report was wrong.


#12

Got the same error when accessing https://2016.halite.io/api/web/errorLog?errorLogName=1-1479579611.log while not logged in. Once I log in, I can access this link without issues. Looks like this should be a 403 instead of this error.

<br />
<b>Notice</b>:  Undefined index: userID in <b>/home/ubuntu/Halite/website/api/web/WebsiteAPI.php</b> on line <b>441</b><br />
<br />
<b>Warning</b>:  mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in <b>/home/ubuntu/Halite/website/api/API.class.php</b> on line <b>51</b><br />
null

#13

Ah. I misunderstood this bug report. Thought that you all were getting "Undefined index: userID...." in your actual error logs.

The error you were receiving pops up when you are trying to access an error log that is not owned by you or when you are not logged in.

I got rid of the error and added a more descriptive message.