Error: Detected applied migration not resolved locally: 2.32.20

@Ameen I am not using released war file, i compiled latest code locally and generated war file. I already tried 2.32 demo DB but got those errors. so i think either the DB or the source code must be changed? please guide

1 Like

@affan Then it depends on the branch which you are using. If you are using master branch then you should use dhis2-demo-db/sierra-leone/dev at master ¡ d2-ci/dhis2-demo-db ¡ GitHub

If you are using 2.32 branch when building locally, then you have to use the previous link that I shared.

Note that the links were updated yesterday and day before yesterday. So you need to take a “git pull” to get the latest changes if you have not already done so.

1 Like

@Ameen i got your point. i used master branch so i think dev DB is the one i need. let me pull latest changes and import dev DB. i will get back to you with results. thanks

1 Like

@Ameen I pulled latest source code from master branch. but when i ‘mvn clean install’ i get this error:

javac: directory not found: /path/to/dhis/code/dhis2-core/dhis-2/dhis-api/target/classes

the said directory ‘classes’ is not available in target folder, however if i see old version of code, this directory was available. i am not sure if this directory and its content is created during install or not? please guide

1 Like

@affan This is not an issue with the source code itself but something to do with your build setup. How are you building the source code? In an IDE? Try cleaning the project if its in IDE. Otherwise you can also execute “mvn clean install” using commandline.

1 Like

@Ameen i am not using any IDE. just building from terminal using “mvn clean install” command. first time when i compiled the old version of code then i did not get such error. i thought something changed in latest code.

1 Like

@affan Can you share the full build error here? We are noticing something strange as well , want to confirm if its the same issue with your build as well.

1 Like

here is the full error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project dhis-api: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] javac: directory not found: /home/affan/palab/dhis2-sourcecode/dhis2-core/dhis-2/dhis-api/target/classes
[ERROR] Usage: javac <options> <source files>
[ERROR] use -help for a list of possible options
[ERROR] 
[ERROR] 
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project dhis-api: Compilation failure
Failure executing javac, but could not parse the error:
javac: directory not found: /home/affan/palab/dhis2-sourcecode/dhis2-core/dhis-2/dhis-api/target/classes
Usage: javac <options> <source files>
use -help for a list of possible options


    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
Failure executing javac, but could not parse the error:
javac: directory not found: /home/affan/palab/dhis2-sourcecode/dhis2-core/dhis-2/dhis-api/target/classes
Usage: javac <options> <source files>
use -help for a list of possible options


    at org.apache.maven.plugin.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:656)
    at org.apache.maven.plugin.CompilerMojo.execute (CompilerMojo.java:128)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :dhis-api
1 Like

HI @Ameen, hope you are doing fine. Did you get chance to look into the compile error i am getting in latest code from master?
Also, if i want to skip the code compiling part, then can you please tell me which pre-compiled war file i can use with this https://github.com/dhis2/dhis2-demo-db/tree/master/sierra-leone/dev version of demo DB?
thanks

1 Like

@affan You can download the latest dev war from here https://ci.dhis2.org/job/dhis2-dev/lastSuccessfulBuild/artifact/dhis-2/dhis-web/dhis-web-portal/target/dhis.war

The earlier issue which we saw is no more there now. So if you can take a latest pull of master, that should also ideally work.

2 Likes

@Ameen i have used the specified war file along with latest dev db dump. Now the error message changed:

SQL State : 42P07
Error Code : 0
Message : ERROR: relation “mapview_categorydimensions” already exists
Location : org/hisp/dhis/db/migration/2.32/V2_32_20__Create_populate_mapview_filter_dimension_tables.sql (/file:/opt/tomcat8/webapps/dhis/WEB-INF/lib/dhis-support-db-migration-2.33-SNAPSHOT.jar!/org/hisp/dhis/db/migration/2.32/V2_32_20__Create_populate_mapview_filter_dimension_tables.sql)
Line : 4
Statement : create table public.mapview_categorydimensions (
mapviewid int8 not null,
categorydimensionid int4 not null,
sort_order int4 not null,
constraint mapview_categorydimensions_pkey primary key (mapviewid, sort_order),
constraint fk_mapview_categorydimensions_categorydimensionid foreign key (categorydimensionid) references categorydimension(categorydimensionid),
constraint fk_mapview_categorydimensions_mapviewid foreign key (mapviewid) references mapview(mapviewid)
)

please guide what to do?

1 Like

That is strange.

Can you execute
Select * from flyway_schema_history;
on the db and share the results?

1 Like

@affan Is it resolved?

1 Like

@Ameen sorry for late response. I was playing around with different combination of war file and DB dump. i was able to deploy and run war file from version 2.28. But it seems it is quiet old version compared to the dev version. and i am still not sure if source code from 2.28 version will compile on my machine or not. I never thought this would be so difficult thing to do. Ideally, i should be able to compile and run code from version 2.30 atleast, so that I can continue further development. I am going to try running 2.30 version now, i will update you once done. Thanks

1 Like

I feel you can start with the released version of 2.32, as it is stable. Dev version would not be ideal to start as it will have changes/updates regularly which may not be 100% working.

2 Likes

@Ameen thanks for the advice. i will try 2.32 now :slight_smile:

1 Like

@Ameen i got errors in version 2.32, however i was able to compile and run code from version 2.30. I think this seems a good enough version to start my work so i will stick to it for now. thanks you very much for your help, much appreciated :+1:

1 Like