conveyal / analysis-backend

Server component of Conveyal Analysis
http://conveyal.com/analysis
MIT License
23 stars 12 forks source link

Fail to build #245

Closed arunaxp closed 4 years ago

arunaxp commented 4 years ago

Hi, I'm new to java and wanted to up and running this on my pc, I tried to build nvm package, but im getting bellow mentioned error

Failed to execute goal on project analysis: Could not resolve dependencies for project com.conveyal:analysis:jar:5.7.0: Could not find artifact com.axiomalaska:polyline-encoder:jar:0.1 in sonatype-oss (https://oss.sonatype.org/content/repositories/snapshots/)

  1. https://github.com/conveyal/analysis-backend/blob/v5.7.0/pom.xml is referring

    <dependency>
        <groupId>com.conveyal</groupId>
        <artifactId>r5</artifactId>
        <version>4.6.0</version>
    </dependency>
  2. https://github.com/conveyal/r5/blob/v4.6.0/pom.xml is referring

    com.axiomalaska polyline-encoder 0.1

This r5 v4.6.0 build fail because of the polyline-encoder version 0.1, and only version that build successfully is r5-> v4.8.0 which is referring polyline-encoder v0.2.

if I try to add reference r5->v4.8.0 into conveyal/analysis-backend v5.7.0 it throwing compile errors.

Please advice me on this.

magdasalatka commented 4 years ago

I have run into the same problem. I managed to solve it, by adding the following repositories in pom.xml:

        <repository>
            <id>locationtech</id>
            <name>Locationtech</name>
            <url>https://mvnrepository.com/artifact/org.locationtech.jts/jts-core</url>
        </repository>
        <repository>
            <id>axiom-public-releases</id>
            <name>Axiom Releases</name>
            <url>http://nexus.axiomalaska.com/nexus/content/repositories/public-releases</url>
        </repository>

However, I eventually run into another version conflict and cannot complete the build either. @trevorgerhardt @abyrd could you advise on the version match between r5 and analysis-backend?

arunaxp commented 4 years ago

Hi @magdasalatka,

Thank you for your response, I could figure it out what was missing and attached patch file would solve it patch file URL.

magdasalatka commented 4 years ago

Hi @arunaxp, thnaks for thaking it up! Unfortunately I am not able to reproduce your results. Did you use master branch? Could you share whole pom.xml file?

arunaxp commented 4 years ago

Hi,

I would really appreciate your response @magdasalatka . this is my pom file analysis-backend/pom.xml

Last couple of week I have started working on Conveyal and I could make it work now , Still I couldn't understand how it works, since "Fetching Results" take long time.

I would really appreciate if any one could help me out.

These are the steps...

  1. Setting up a new region
  2. Upload OpenStreetMap (OSM) data https://protomaps.com/extracts/fce89e25-10bd-4f71-ad28-72f24da57778
  3. Uploading a GTFS (General Transit Feed Specification) bundle https://www.transperth.wa.gov.au/About/Spatial-Data-Access https://transitfeeds.com/p/transperth/2 4.Created a project 5.I DIDN'T CREATE "Opportunity Dataset" and "Modifications"
  4. I tried to "Fetch results", But it take long but didn't seem to work.

I would you be able to give me heads up on this.?

image

abyrd commented 4 years ago

Hi @arunaxp and @magdasalatka, generally Conveyal doesn't provide support for third-party deployments of Analysis, but you are of course welcome to adapt or reuse the code. See the repo's readme for a little more explanation.

We started migrating some of our projects to Java 11+ which involves a whole raft of dependency updates. I proposed some changes to the polyline encoder authors, allowing it to build under Java 11. They accepted and made a new release. Somehow in the process we lost access to the older artifact so the build can no longer complete.

We've got our own modified branches that will build under Java 11 and cooperate with newer releases of R5, we were planning to clean those up and push them to this repo within a month or so. Of course we would prefer not to have a reproducible build into the future. To achieve this we'd have to find a copy of polyline encoder v0.1 and upload it to a repository we control. Conveyal has its own Maven repo for this kind of stopgap purposes, I may be able to find the artifact and publish it there.

abyrd commented 4 years ago

@arunaxp can you clarify why you closed the issue and whether you resolved your issues?

arunaxp commented 4 years ago

Hi @abyrd,

Thank you for your reply šŸ‘ . I could manage to fixed the build issues adding patch file and @magdasalatka also pointed out the same fix.

Secondly I had a issue with analyser, since it throws a run-time error

ERROR com.conveyal.taui.AnalysisServer - org.opengis.referencing.datum.DatumFactory is not an ImageIO SPI class

while I trying to execute analyser. I had to downgrade into java version 8 from version 11. currently I could run analyser without any issues. šŸ‘

I would like to suggest, even though Conveyal has their own pricing model, it would be better if its had a more descriptive installation guidance. Because It would support to test it on their own PCs.

abyrd commented 4 years ago

Oh I see, you already posted the patch URL. Thanks. I have uploaded the polyline encoder v0.1 artifact to the Conveyal repo, that should also help ensure builds are reproducible. I don't plan to spend much more time getting the master branch to build because within a few weeks I expect to push a larger set of updates that I know will give a more coherent build.

We eventually would like to produce a version of Conveyal Analysis that is easier to start locally (so people can try it out) with our hosted service providing them scalable cluster computation for large projects. But for now we have to focus on the hosted service for our customers.

CScons commented 4 years ago

Hi @arunaxp

Thanks to your patch I was able to build both r5 and analysis-backend-master. I however am still unable to get analysis-ui-dev working (I'm a planning guy, not a developer).

Below the situation I'm in:

  1. analysis-ui-dev: 1.1. nothing happen once npm install has run (not sure if that's expected)

  2. analysis-backend-master 2.1. build success 2.2. when launching analysis.jar, it stops at "c.c.r5.analyst.cluster.AnalystWorker - Polling the broker did not yield any regional tasks. Sleeping 15+1 sec." 2.3. no page is loading at http://localhost:9966/

  3. r5 3.1. build success 3.2. when running "java -jar -Xmx4G target/v3.0.0.jar worker" I got the error "Unable to access jarfile target/v3.0.0.jar"

Therefore

  1. Would you mind confirming which version of the three apps you are using?
  2. Would you be kind enough to walk me through the steps to get analyser working?

Thanks

arunaxp commented 4 years ago

Hi @CScons,

This more into dev stuff, I will pointed out the steps that I took.

  1. I used Master branch.

    i. npm i yarn ii. yarn install next react react-dom iii. npm run dev

Above commands would download all references. And I did sort of hack to make it work, since I just wanted to see how it works.

go to "next.config.js" locate in root folder. open in an editor and modified the const env

hardcoded the configuration in this file as follows.

// Add defaults for AUTH0 if auth is disabled const AUTH_DISABLED = process.env.AUTH_DISABLED === 'true'

const env = { ADMIN_ACCESS_GROUP: process.env.ADMIN_ACCESS_GROUP || 'conveyal', API_URL: 'http://localhost:7070', AUTH_DISABLED, AUTH0_CLIENT_ID: AUTH_DISABLED ? 'unrequired' : process.env.AUTH0_CLIENT_ID, AUTH0_DOMAIN: AUTH_DISABLED ? 'unrequired' : process.env.AUTH0_DOMAIN, LOGROCKET: process.env.LOGROCKET || false, MAPBOX_ACCESS_TOKEN: "MAPBOX_ACCESS_TOKEN" }

Application intended to create environment variables, but in here I just hard coded them in the file. goto -> mapbox site and create a API key and replace the "MAPBOX_ACCESS_TOKEN".

This iii. npm run dev command should run the client app on http://localhost:3000/.

2. You have to follow the installation instruction given in Conveyal site. This is my settings file analysis.properties 2.2 Seem this is not an issue, because back end keep running, it execute when it needed. 2.3 Conveyal client run on "http://localhost:3000/"

  1. I didn't use r5 separately. probably you wouldn't need it.

Please let me know how this goes.

CScons commented 4 years ago

Thanks @arunaxp for the prompt and detailed response. Much appreciated! I must be doing something wrong or missing a step because

  1. since I modified "analysis.properties" to match your settings I've got a build failure on "org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test". 1.1. The failed test is "canCreateReadAndDeleteABundle(com.conveyal.taui.controllers.BundleControllerTest)"

  2. when running "npm run dev" it compiled successfully but 2.1. I then have the following error when trying to access "http://localhost:3000/" image 2.2. error which is reflected in the command prompt image

arunaxp commented 4 years ago

Hi @CScons ,

First, you have to make sure back end up and running before the client start. Please try bellow command on back end before start it info: hope you already setup the Mongo DB on your PC. if not follow the Conveyal installation guid

  1. mvn clean install -Dmaven.test.skip
  2. java -Xmx2g -jar target/analysis.jar

If its succeeded, you can start your client application. I suspect this client issue happens, because of the back-end issue (authentication fails).

Try and let me know the progress.

CScons commented 4 years ago

Hey, thanks again @arunaxp for the prompt response!

  1. I couldn't run a clean install: "Failed to clean project: Failed to delete C:\Apps\Conveyal\analysis-backend\target\surefire-reports" but was able to run "mvn install -Dmaven.test.skip "

  2. Unfortunately that didn't changed the outcome on http://localhost:3000

  3. My Mongo DB looks like that: image

I'll go through the Conveyal installation guide once again to make sure that I didn't miss a step.

note: I've downgraded to jdk1.8.0_241 and I'm trying to run analysis backend version 5.8.0-SNAPSHOT with analysis ui v.4.12.0

arunaxp commented 4 years ago

Hi @CScons,

Did you able to run Conveyal back end without any issue?

CScons commented 4 years ago

the build is successful. It might be relevant: when running the .jar, it works fine but then start repeating this line: "16:12:22.210 [WORKER 0] INFO c.c.r5.analyst.cluster.AnalystWorker - Polling the broker did not yield any regional tasks. Sleeping 15 + 4 sec."

image

arunaxp commented 4 years ago

Hi @CScons,

I'm not quite sure whats is happening on client application, If its saying that "User not Logged in" its because of client application unable to set its "AUTH_DISABLED" to "true".

Try it on my code

`npm i yarn`
`yarn install next react react-dom`
`npm run dev`

Good luck :)

CScons commented 4 years ago

Thanks @arunaxp. I've very much appreciated your help. I'll give a try to your version. I'll keep you updated once successful! Thanks again for your time.

CScons commented 4 years ago

Hey @arunaxp. Your version fixed my issue. I'll investigate to understand the difference with the one I had but thank you very much!

jamesdeweese commented 4 years ago

hi @arunaxp and @CScons, I've been working on setting up my own local version of Conveyal as sort of an experiment. Don't know anything really about working with java or javascript code, but thanks to a lot of Googling and your troubleshooting here, I think I'm very nearly there.

As far as I can tell, I have the backend running properly. I couldn't use maven package. Instead I used your <maven clean install ... > and skipped the tests, which were generating build failures. When I start up using @ansoncfit 's code, the backend seems to start ...

jamesdeweese@MacBook-Pro-2 analysis-backend % java -cp target/shaded/v5.9.0-4-g5055dd9-dirty.jar com.conveyal.analysis.BackendMain

gives me (among other INFO messages):

14:04:23.078 [main] INFO com.conveyal.analysis.BackendMain - Starting Conveyal analysis backend, the time is now 2020-08-06T14:04:23.045-04:00 14:04:23.088 [main] INFO com.conveyal.analysis.BackendMain - Backend version is: v5.9.0-4-g5055dd9-dirty 14:04:23.088 [main] INFO com.conveyal.analysis.BackendMain - Connecting to database... 14:04:23.091 [Thread-1] INFO s.e.jetty.EmbeddedJettyServer - == Spark has ignited ... 14:04:23.091 [Thread-1] INFO s.e.jetty.EmbeddedJettyServer - >> Listening on 0.0.0.0:7070

So I think that means it's working. But I'm now stumped on the frontend. I opened a second Terminal because I couldn't get a prompt in the one where I launched the backend ... I get the same repeating "14:31:11.560 [WORKER 0] INFO c.c.r5.analyst.cluster.AnalystWorker - Polling the broker did not yield any regional tasks. Sleeping 15 + 3 sec."

In the new terminal, I used npm to compile and start the frontend server.

jamesdeweese@MacBook-Pro-2 analysis-ui % npm run dev

It also seems to be working, see below. But then I get this error:

"A valid Auth0 Domain must be provided". I know you mentioned this in your troubleshooting, but I couldn't figure out how you fixed it other than to use the other code @arunaxp provided. The problem is, I tried it with that code but it kept erroring out.

Any help would be greatly appreciated.

Thanks in advance, Jamie

@conveyal/analysis-ui@0.0.0-semantic.release predev /Users/jamesdeweese/Documents/GitHub/analysis-ui yarn

yarn install v1.22.4 [1/5] šŸ” Validating package.json... [2/5] šŸ” Resolving packages... success Already up-to-date. āœØ Done in 0.58s.

@conveyal/analysis-ui@0.0.0-semantic.release dev /Users/jamesdeweese/Documents/GitHub/analysis-ui next

ready - started server on http://localhost:3000 warn - You have enabled experimental feature(s). warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.

info - Using external babel configuration from /Users/jamesdeweese/Documents/GitHub/analysis-ui/.babelrc event - compiled successfully event - build page: / wait - compiling... event - compiled successfully event - build page: /api/session wait - compiling... event - compiled successfully Error: A valid Auth0 Domain must be provided at Object.createInstance [as default] (/Users/jamesdeweese/Documents/GitHub/analysis-ui/node_modules/@auth0/nextjs-auth0/dist/instance.node.js:10:15) at initAuth0 (/Users/jamesdeweese/Documents/GitHub/analysis-ui/node_modules/@auth0/nextjs-auth0/dist/index.js:8:46) at webpack_exports.default (webpack-internal:///./lib/auth0.ts:19:79) at webpack_exports.default (webpack-internal:///./pages/api/session.ts:5:74) at apiResolver (/Users/jamesdeweese/Documents/GitHub/analysis-ui/node_modules/next/dist/next-server/server/api-utils.js:8:7) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) at async DevServer.handleApiRequest (/Users/jamesdeweese/Documents/GitHub/analysis-ui/node_modules/next/dist/next-server/server/next-server.js:48:397) at async Object.fn (/Users/jamesdeweese/Documents/GitHub/analysis-ui/node_modules/next/dist/next-server/server/next-server.js:40:218) at async Router.execute (/Users/jamesdeweese/Documents/GitHub/analysis-ui/node_modules/next/dist/next-server/server/router.js:38:67)