Getting Exception with HEAD version

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting Exception with HEAD version

Daniel
Hi,

I am currently running the HEAD version, since it contains a fix of an issue that happened in 1.0.0. Using the HEAD version, on timeslot 372 I got the exception below. This exception also affect brokers: it causes not calling not calling a broker's activate() function for timeslot 372.

100152 INFO  common.TariffEvaluator: Evaluated tariff 200000146: cost=-358424.8260574083, inconvenience=0.0
100152 INFO  common.TariffEvaluator: Evaluated tariff 200000149: cost=-370397.29985895765, inconvenience=0.0
100153 INFO  common.TariffEvaluator: Evaluated tariff 200000152: cost=-381126.2843571647, inconvenience=0.0
100154 INFO  common.TariffEvaluator: Evaluated tariff 200000143: cost=-346257.0847379917, inconvenience=0.0
100154 INFO  common.TariffEvaluator: customer OfficeComplex 1 SS Base subscribes 3 to tariff 200000149
100154 INFO  common.TariffEvaluator: customer OfficeComplex 1 SS Base unsubscribes 3 from tariff 300000024
100155 ERROR server.CompetitionControlService: java.lang.ArrayIndexOutOfBoundsException: -1
.. org.powertac.officecomplexcustomer.appliances.CopyMachine.dailyShifting(CopyMachine.java:177)
.. org.powertac.officecomplexcustomer.customers.Office.dailyShifting(Office.java:1168)
.. org.powertac.officecomplexcustomer.customers.OfficeComplex.dailyShifting(OfficeComplex.java:1320)
.. org.powertac.officecomplexcustomer.customers.OfficeComplex$TariffEvaluationWrapper.getCapacityProfile(OfficeComplex.java:1580)
.. org.powertac.common.TariffEvaluator.forecastCost(TariffEvaluator.java:465)
100155 INFO  server.CompetitionControlService: Wait for tick 14
104994 INFO  server.CompetitionControlService: Deactivated timeslot 374, start 2009-10-25T14:00:00.000Z
104994 INFO  server.CompetitionControlService: Activated timeslot 398, start 2009-10-26T14:00:00.000Z
104996 INFO  server.CompetitionControlService: step at 2009-10-25T14:00:00.000Z

Thanks,
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exception with HEAD version

achryso
I am seeing my code as well as the github page https://github.com/powertac/officecomplex-customer/blob/master/src/main/java/org/powertac/officecomplexcustomer/appliances/CopyMachine.javahttps://github.com/powertac/officecomplex-customer/blob/master/src/main/java/org/powertac/officecomplexcustomer/appliances/CopyMachine.java

and there is no code in line 177 of the class suggested
(org.powertac.officecomplexcustomer.appliances.CopyMachine.dailyShifting(CopyMachine.java:177))

Are you sure that you have the right code, the latest head??? I have fixed this, since the problem was that minIndex was keeping value -1 in

178     newControllableLoad[minIndex] += power;

but by adding the second part in

167     if (counter == OfficeComplexConstants.END_OF_FUNCTION_HOUR
                     - OfficeComplexConstants.START_OF_FUNCTION_HOURS
          || minIndex == -1)

on this if clause this should not happen at any time.

Anyway, if this happening even though you are sure that you have the latest master and these code lines are in place, I will remove shifting altogether and there should be no problem at the competition.

Thank you again for your error reporting.

Antonios.
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exception with HEAD version

Daniel
Hi Antonios,

Thanks for your response.
I am pretty sure I am using the HEAD version: I got it by running 'git pull' for both common, powertac-server and all of its submodules. This is the output of running git branch and git log under powertac-server:
$ git branch
* master

$ git log
commit 1a30249bbcbb7c81f3412718dc2f79e00656c02a
Author: Govert Buijs <buijs@rsm.nl>
Date:   Mon Jul 1 16:24:41 2013 +0200

    Updated PrimeFaces and Atmosphere versions; fixed #710

commit 5f15a77e24d917c39fc430893c8eb2297bb4af95
Author: John Collins <jcollins@cs.umn.edu>
Date:   Thu Jun 27 23:32:02 2013 -0500

    new development series 1.0.1-SNAPSHOT

commit 806a077165c858a9d3e54b6c5553299a4be0919e
Author: John Collins <jcollins@cs.umn.edu>
Date:   Thu Jun 27 14:10:57 2013 -0500

    1.0.0 release prep

commit 145d774c7aff35db951389db453a5f00a8dc9a23

Is it indeed what you would expect to see in the HEAD version?

Thanks,
Daniel

Reply | Threaded
Open this post in threaded view
|

Re: Getting Exception with HEAD version

grampajohn
Administrator
I just loaded up a HEAD version of everything, and it's all working fine. I am concerned that you do not actually have a HEAD setup. Here's what I did:

- make sure common, server-distribution, powertac-server, and all the components under powertac-server are on the master branch, using
   git status
and in powertac-server
   git submodule foreach git status
Then, in common, server-distribution, and powertac-server  I made sure I was up-to-date with
   git pull origin master
and in powertac-server
   git submodule foreach git pull origin master
Then I installed everything locally. In common and in powertac-server I did
   mvn clean install
Then in server-distribution I did a boot and sim session using mvn, as explained in the README. It all works fine. No errors.

Is this what you did?

Cheers -

John
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exception with HEAD version

Daniel
Hi John,

Thanks for your message.
In powertac-server, server-distribution, and common, everything seems fine.

when running
'git submodule foreach git status'
I got a "HEAD detached" message. Could it be the reason for not being updated?

Thanks,
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exception with HEAD version

Daniel
PS
I am also getting the 'HEAD detached' status after cloning a fresh version of the server from

git://github.com/powertac/powertac-server.git
git://github.com/powertac/common.git
git://github.com/powertac/server-distribution.git

Thanks,
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exception with HEAD version

gbuijs
That's strange.

Could you try a 'git pull origin master' in the directory that gave the 'HEAD detached'?
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exception with HEAD version

Daniel
When running 'git pull origin master' it shows that everything is fine, but git status shows the head detached message:

powertac-server/accounting$ git status
# HEAD detached from a23b9c0
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   .classpath
#       modified:   .gitignore
#


powertac-server/accounting$ git pull origin master
From git://github.com/powertac/accounting
 * branch            master     -> FETCH_HEAD
Already up-to-date.


Thanks,
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exception with HEAD version

grampajohn
Administrator
Daniel wrote
When running 'git pull origin master' it shows that everything is fine, but git status shows the head detached message:

powertac-server/accounting$ git status
# HEAD detached from a23b9c0
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   .classpath
#       modified:   .gitignore
#
Interesting. It's common to have .classpath shown as changed, because Eclipse changes it. But it should be listed in .gitignore; you can always re-create it using maven->update project configuration. Did you modify .gitignore? Is there a change to .gitignore that you would like to see in the master branch?

If these are the only changes, and if you don't need the change to .gitignore, then you can just discard them with
   git checkout -- .
and then do a fresh pull. You need to do this in the module that's giving you problems, which appears to be powertac-server/accounting. There's a detailed explanation of how this works on StackOverflow.

Cheers -

John
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exception with HEAD version

Daniel
Hi John,

The problem might be different, since after running a fresh clone:

git clone --recursive git://github.com/powertac/powertac-server.git

and before doing anything else, I get a 'HEAD detached' status on each of the server's modules.
Does it happen to you as well, after cloning a fresh copy?

Regarding .gitignore - I checked it and there is some bug in my STS that keeps changing .gitignore by adding thousands of 'target' lines to it, but it seems unrelated to the detached head problem.

Thanks again,
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exception with HEAD version

grampajohn
Administrator
Daniel wrote
Hi John,

The problem might be different, since after running a fresh clone:

git clone --recursive git://github.com/powertac/powertac-server.git

and before doing anything else, I get a 'HEAD detached' status on each of the server's modules.
Does it happen to you as well, after cloning a fresh copy?
Yes. The problem is that the powertac-server module includes a list of submodules and associated git versions. These versions are almost always out-of-date, and often don't even get updated when pushing to powertac-server. I have never taken the time to figure out why, because these versions are almost always wrong anyway. So here's what works - I just tested it:
   git clone --recursive git://github.com/powertac/powertac-server.git
   cd powertac-server
   git submodule foreach git checkout master
   git submodule foreach git pull origin master
This is what's documented in the Getting Started page, with the addition of the "git checkout master" command. You only need to do that if you get the "detached HEAD" message. I'll update the wiki on this.

Hope this helps...

John
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exception with HEAD version

Daniel
Hi John,

After running these commands I no longer get the 'HEAD detached' message.

Thanks!
Daniel