Problem with running the server

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

Problem with running the server

Jasper
Dear all,

I've been trying to run the server and the sample broker, but I ran into a problem. I'm not experienced with Maven, so It might have something to do with that. This is what I've done so far:

I downloaded the server following the link given in the announcement of the 0.2.0 release:
http://power-tac-developers.975333.n3.nabble.com/Announcement-Power-TAC-server-release-0-2-0-td3766988.html

Then I followed the instruction from the readme file. First I ran the server in bootstrap mode by calling
mvn exec:exec -Dexec.args="--boot config/bootstrap.txt"
At the end of the run the following message appeared a couple of times:
log4j:ERROR Attempted to append to closed appender named [null].
I ignored this message assuming it wouldn't be harmful.

I then ran the server in simulation mode by calling
mvn exec:exec -Dexec.args="--sim --boot-data bootstrapfile --brokers Sample"

I downloaded the Sample Broker from https://github.com/powertac/sample-broker/downloads and imported it as an existing Maven project into STS. I then ran BrokerMain as an AspectJ/Java Application.

The broker connects to the server succesfully because it is receiving messages. However, it immediately gets stuck in the SampleBroker.waitForActivation() method. The thread waits for the condition timeslotCompleted <= index to become false, which never happens. The variable timeslotCompleted is only set by the handleMessage(TimeslotComplete tc) method, which should be invoked when the broker receives a TimeslotComplete message. However, the server never seems to send such a message.

In the post http://power-tac-developers.975333.n3.nabble.com/strange-bug-td3796242.html it is told that the TimeslotComplete message is added to the server at a later date. Therefore I tried to get a newer version of the server, but so far I have not been able to run it succesfully. This time I downloaded the server from https://github.com/powertac/powertac-server/downloads and tried to run it in boot mode. However this gave the error message that artifact org.powertac:server-distribution:pom:0.5.0-SNAPSHOT is missing.

Like I said, I am not experienced with Maven, so I suspect it has something to do with that. I've tried I couple of things, but so far without success. Does anyone know what I've done wrong? Thanks in advance.

Jasper
Reply | Threaded
Open this post in threaded view
|

Re: Problem with running the server

grampajohn
Administrator
Jasper -

Thank you for your interest in Power TAC. As you know, we are actively developing on the 0.5.0-SNAPSHOT series. As a result, there are sometimes inconsistencies that escape our notice for a day or so. That happened yesterday; if this caused a problem for you, we apologize.

Jasper wrote
I've been trying to run the server and the sample broker, but I ran into a problem. I'm not experienced with Maven, so It might have something to do with that. This is what I've done so far:

I downloaded the server following the link given in the announcement of the 0.2.0 release:
http://power-tac-developers.975333.n3.nabble.com/Announcement-Power-TAC-server-release-0-2-0-td3766988.html

Then I followed the instruction from the readme file. First I ran the server in bootstrap mode by calling
mvn exec:exec -Dexec.args="--boot config/bootstrap.txt"
At the end of the run the following message appeared a couple of times:
log4j:ERROR Attempted to append to closed appender named [null].
I ignored this message assuming it wouldn't be harmful.
Those error messages can be safely ignored. I believe they have gone away in the development series.

The result of this should have been a new file config/bootstrap.txt. It's an xml file that contains the bootstrap data used to "seed" a simulation run.
I then ran the server in simulation mode by calling
mvn exec:exec -Dexec.args="--sim --boot-data bootstrapfile --brokers Sample"
I'm surprised this did not cause an error, unless by "bootstrapfile" you mean file:config/bootstrap.txt. Note that the --boot-data argument in sim-mode is a URL, not a simple filename. This will allow the bootstrap data to be supplied by an external tournament manager, currently under development.
I downloaded the Sample Broker from https://github.com/powertac/sample-broker/downloads and imported it as an existing Maven project into STS. I then ran BrokerMain as an AspectJ/Java Application.

The broker connects to the server succesfully because it is receiving messages. However, it immediately gets stuck in the SampleBroker.waitForActivation() method. The thread waits for the condition timeslotCompleted <= index to become false, which never happens. The variable timeslotCompleted is only set by the handleMessage(TimeslotComplete tc) method, which should be invoked when the broker receives a TimeslotComplete message. However, the server never seems to send such a message.
The 0.2.0 broker download package is at https://github.com/powertac/powertac-server/downloads. The package you got was the 0.5.0-SNAPSHOT source package, which does indeed have a new message type and a check to make sure the broker is in sync with the server. But it requires the newer server to work correctly.
In the post http://power-tac-developers.975333.n3.nabble.com/strange-bug-td3796242.html it is told that the TimeslotComplete message is added to the server at a later date. Therefore I tried to get a newer version of the server, but so far I have not been able to run it succesfully. This time I downloaded the server from https://github.com/powertac/powertac-server/downloads and tried to run it in boot mode. However this gave the error message that artifact org.powertac:server-distribution:pom:0.5.0-SNAPSHOT is missing.
Instructions for running the server from source are on the developer's wiki. If you don't want to run it inside the IDE, then you will have to do mvn install (to create local copies of the maven artifacts) on all the modules, including powertac-server/server-master and powertac-server/server-distribution. This has to be done in dependency order: common, server-master, server-interface, all the service modules, server-main, server-distribution.
Like I said, I am not experienced with Maven, so I suspect it has something to do with that. I've tried I couple of things, but so far without success. Does anyone know what I've done wrong? Thanks in advance.

Jasper
No problem. There's a learning curve for maven, but once you have put in a bit of effort, it's a pretty amazing tool.

Let me know if this does not solve your problem.

John
Reply | Threaded
Open this post in threaded view
|

Re: Problem with running the server

Jasper
Thanks for the reply. I meant "bootstrapfile" to be a variable, but I forgot to mark it as such.

I will now try to get it working with your instructions. I'll let you know if I succeed.

Jasper
Reply | Threaded
Open this post in threaded view
|

Re: Problem with running the server

Jasper
In reply to this post by grampajohn
I tried to follow the instructions on https://github.com/powertac/powertac-server/wiki/Getting-started, but I got stuck again. In particular, I tried to run the server outside STS. These are the steps I've taken:

First I called "git clone --recursive git://github.com/powertac/powertac-server.git" to download the server.

At first I assumed I didn't need the "common" module since I only want to run the server.

Then I attempted to install the maven artifacts. Assuming I didn't need common I skipped the "mvn install" call for this module. I went to the powertac-server/server-master directory immediately and called "mvn install". This seemed to work fine. I then went to the powertac-server/server-interface directory and called "mvn install" from here. This time I got the following error:

bash-4.1$ mvn install
/usr/lib/jvm/java
[INFO] Scanning for projects...
Downloading: https://oss.sonatype.org/content/repositories/snapshots//org/powertac/server-master/0.2.0-SNAPSHOT/server-master-0.2.0-SNAPSHOT.pom
[INFO] Unable to find resource 'org.powertac:server-master:pom:0.2.0-SNAPSHOT' in repository sonatype (https://oss.sonatype.org/content/repositories/snapshots/)
[WARNING] Skipping jpp repository file:///usr/share/maven2/repository in vanilla mode
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: null:server-interface:jar:null

Reason: Cannot find parent: org.powertac:server-master for project: null:server-interface:jar:null for project null:server-interface:jar:null


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.powertac:server-master for project: null:server-interface:jar:null for project null:server-interface:jar:null
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:272)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: org.powertac:server-master for project: null:server-interface:jar:null for project null:server-interface:jar:null
        at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1396)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:508)
        at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
        at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487)
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
        ... 12 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.powertac:server-master' not found in repository: Unable to download the artifact from any repository

  org.powertac:server-master:pom:0.2.0-SNAPSHOT

from the specified remote repositories:
  sonatype (https://oss.sonatype.org/content/repositories/snapshots/),
  central (http://repo1.maven.org/maven2),
  __jpp_repo__ (file:///usr/share/maven2/repository)

 for project org.powertac:server-master
        at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)
        at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1392)
        ... 18 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository

  org.powertac:server-master:pom:0.2.0-SNAPSHOT

from the specified remote repositories:
  sonatype (https://oss.sonatype.org/content/repositories/snapshots/),
  central (http://repo1.maven.org/maven2),
  __jpp_repo__ (file:///usr/share/maven2/repository)


        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:236)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:97)
        at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
        ... 19 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
        at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:407)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:224)
        ... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Wed Mar 21 12:09:17 CET 2012
[INFO] Final Memory: 3M/118M
[INFO] ------------------------------------------------------------------------

I also tried something else: I called "git clone git://github.com/powertac/common.git" to download common and then "mvn install" from the common directory.  After that I proceeded as I described above. This gave the same error though, when I arrived at the "mvn install" call in the powertac-server/server-interface directory.

Do you know what's causing this problem? Thanks in advance.

Jasper
Reply | Threaded
Open this post in threaded view
|

Re: Problem with running the server

grampajohn
Administrator
Jasper and all -

Jasper wrote
I tried to follow the instructions on https://github.com/powertac/powertac-server/wiki/Getting-started, but I got stuck again. In particular, I tried to run the server outside STS. These are the steps I've taken:

First I called "git clone --recursive git://github.com/powertac/powertac-server.git" to download the server.
Ah - I see what's happening, and I apologize for the confusion. This is a step that has not been in our testing, and it needs to be. Every time you update a git submodule (server-interface, accounting, etc.), the MD5 version of the submodule changes in the "super-module" - powertac-server. But since the developers are working on individual modules, the powertac-server module does not get committed. That does not cause any problems in a development environment, but it causes the git clone --recursive to get the wrong versions. If you were a developer, you would then do 'git submodule foreach git pull origin master' and pull down the latest version of each module. If you do that now, it will work. I also just pushed an updated powertac-server module so you will get all the latest modules.

However, it will also pull down a new module officecomplex-customer that is not integrated into the server. You can ignore that for now; it does not yet work correctly.
At first I assumed I didn't need the "common" module since I only want to run the server.
That's correct. The server depends on common, but I have been deploying the latest common to the snapshot repo on a regular basis. I believe the server-master and server-interface modules are up-to-date there also, but that will not always be true unless someone specifically requests an update.
I also tried something else: I called "git clone git://github.com/powertac/common.git" to download common and then "mvn install" from the common directory.  After that I proceeded as I described above. This gave the same error though, when I arrived at the "mvn install" call in the powertac-server/server-interface directory.

Do you know what's causing this problem? Thanks in advance.
Yes, thanks for your patience. It should work now.

John
Reply | Threaded
Open this post in threaded view
|

Re: Problem with running the server

Jasper
Thanks again. server-interface is installed successfully now. So are the service modules. However, I got the following test failures when I tried to install server-main:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.powertac.server.WeatherServiceTest
timeslot 0:2009-04-01T12:00:00.000Z(enabled)
timeslot 0:2009-04-01T12:00:00.000Z(enabled)
timeslot 24:2009-04-02T12:00:00.000Z(enabled)
timeslot 24:2009-04-02T12:00:00.000Z(enabled)
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.174 sec
Running org.powertac.server.CompetitionControlServiceTests
Tests run: 5, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 1.642 sec <<< FAILURE!
Running org.powertac.server.LogServiceTests
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.046 sec
Running org.powertac.server.ServerPropertiesTest
Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 1.061 sec <<< FAILURE!
Running org.powertac.server.ServerMessageReceiverTests
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.022 sec
Running org.powertac.server.BrokerProxyServiceTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.044 sec

Results :

Tests in error:
  testPreGame(org.powertac.server.CompetitionControlServiceTests): Failed to load ApplicationContext
  testPreGameFileReader(org.powertac.server.CompetitionControlServiceTests): Failed to load ApplicationContext
  testRunOnceWriter(org.powertac.server.CompetitionControlServiceTests): Failed to load ApplicationContext
  testRegisterTimeslotPhase(org.powertac.server.CompetitionControlServiceTests): Failed to load ApplicationContext
  testConfig(org.powertac.server.CompetitionControlServiceTests): Failed to load ApplicationContext
  testGetPropertyString(org.powertac.server.ServerPropertiesTest): Failed to load ApplicationContext
  testGetPropertyStringString(org.powertac.server.ServerPropertiesTest): Failed to load ApplicationContext
  testSetUserConfigLast(org.powertac.server.ServerPropertiesTest): Failed to load ApplicationContext
  testSetUserConfigFirst(org.powertac.server.ServerPropertiesTest): Failed to load ApplicationContext
  testIntegerProperty(org.powertac.server.ServerPropertiesTest): Failed to load ApplicationContext
  testGencoConfig(org.powertac.server.ServerPropertiesTest): Failed to load ApplicationContext

Tests run: 27, Failures: 0, Errors: 11, Skipped: 0

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

Please let me know if you see what's going on.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with running the server

grampajohn
Administrator
Jasper -

Again, I apologize, and thank you for your patience. You encountered a lingering effect of an ill-considered change on Monday. I thought that was cleaned up, but one of the test configurations was incorrect. I corrected it, ran all the tests, and pushed the fix. You should be able to just go into server-main and do a git pull to get the corrected version.

All the best -

John
Reply | Threaded
Open this post in threaded view
|

Re: Problem with running the server

Jasper
Thank you very much John, it's working now.

Jasper