I am using the following command to build zeppelin 0.8 on ubuntu
mvn clean package -Pbuild-distr -Pyarn -Pspark-1.6
-Dspark.version=1.6.0 -Phadoop-2.6 -Dhadoop.version=2.6.0-cdh5.9.0 -DskipTests -Pvendor-repo
I am getting following error
[WARNING] warning Unmet peer dependency "eslint#>=3.8.1".
[INFO] [4/4] Building fresh packages...
[INFO] $ bower install --silent
[INFO] Done in 77.54s.
[INFO]
[INFO] --- frontend-maven-plugin:1.3:yarn (yarn build) # zeppelin-web ---
[INFO] Running 'yarn run build' in /home/[USER]/zeppelin/zeppelin-web
[INFO] yarn run v0.18.1
[INFO] $ npm-run-all clean
[ERROR] ERROR: spawn npm ENOENT
[ERROR] error Command failed with exit code 1.
[INFO] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
.
[INFO] Zeppelin: web Application ......................... FAILURE [1:20.415s]
[INFO] Zeppelin: Server .................................. SKIPPED
[INFO] Zeppelin: Packaging distribution .................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:35.974s
[INFO] Finished at: Fri Jan 27 08:44:39 PST 2017
[INFO] Final Memory: 196M/464M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:yarn (yarn build) on project zeppelin-web: Failed to run task: 'yarn run build' failed. (error code 1) -> [Help 1]
[ERROR]
Installing npm on the host resolved the issue for me
Related
I have a blocking issue since days
I tried to deploy this repo on aws amplify and the build fail:
https://github.com/metaplex-foundation/candy-machine-ui
Everything works perfect in local (yarn run dev and yarn run build)
But with amplify:
here the error
2023-01-24T15:12:12.674Z [INFO]: # Executing command: yarn run build
2023-01-24T15:12:12.803Z [INFO]: yarn run v1.22.0
2023-01-24T15:12:12.826Z [INFO]: $ craco build
2023-01-24T15:12:17.161Z [INFO]: Creating an optimized production build...
2023-01-24T15:13:44.769Z [INFO]: Failed to compile.
2023-01-24T15:13:44.771Z [INFO]: Failed to load config "react-app" to extend from.
Referenced from: /codebuild/output/src254071763/src/fake-mint/package.json
2023-01-24T15:13:44.772Z [INFO]:
2023-01-24T15:13:44.847Z [WARNING]: error Command failed with exit code 1.
2023-01-24T15:13:44.848Z [INFO]: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2023-01-24T15:13:44.852Z [ERROR]: !!! Build failed
2023-01-24T15:13:44.853Z [ERROR]: !!! Non-Zero Exit Code detected
2023-01-24T15:13:44.853Z [INFO]: # Starting environment caching...
2023-01-24T15:13:44.853Z [INFO]: # Environment caching completed
Making my own project (https://github.com/770001/buyer) based on https://blogg.kantega.no/webapp-with-create-react-app-and-spring-boot/. After deploying to heroku, I get 404 when the application starts, but the rest controller does not work. I can't figure out why. I fight for several days!
P.S. if I deploy the application following this tutorial, everything works. I don't understand why I have 404.
I tried the same thing with another tutorial - https://hackernoon.com/package-your-react-app-with-spring-boot-a-how-to-guide-cdfm329w - if you deploy it to heroku, everything works. But when I create my (identical) - 404.
Everything works for a localhost. I do via maven jar, run it via java -jar target / <name jar file> then run react via cd frontend, yarn start. Everything is working.
What am I doing wrong?
UPDATE
I added to the root folder of the application Procfile:
web java -Dserver.port=$PORT $JAVA_OPTS -jar target/shmot-0.0.1-SNAPSHOT.war
This is my package.json
{
"name": "front",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^5.11.8",
"#testing-library/react": "^11.2.3",
"#testing-library/user-event": "^12.6.0",
"http-proxy-middleware": "^1.0.6",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.1",
"web-vitals": "^0.2.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
This is my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.khilkevichigor</groupId>
<artifactId>shmot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>shmot</name>
<description>International shopping</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
<configuration>
<workingDirectory>front</workingDirectory>
<installDirectory>target</installDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v12.16.3</nodeVersion>
<npmVersion>6.14.4</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<configuration>
<target>
<copy todir="${project.build.directory}/classes/public">
<fileset dir="${project.basedir}/front/build"/>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
This is Build Log from heroku:
-----> Building on the Heroku-20 stack
-----> Java app detected
-----> Installing JDK 1.8... done
-----> Executing Maven
$ ./mvnw -DskipTests clean dependency:list install
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.khilkevichigor:shmot >----------------------
[INFO] Building shmot 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # shmot ---
[INFO]
[INFO] --- maven-dependency-plugin:3.1.2:list (default-cli) # shmot ---
[INFO]
[INFO] --- frontend-maven-plugin:1.6:install-node-and-npm (install node and npm) # shmot ---
[INFO] Installing node version v12.16.3
[INFO] Unpacking /tmp/codon/tmp/cache/.m2/repository/com/github/eirslett/node/12.16.3/node-12.16.3-linux-x64.tar.gz into /tmp/build_ab545a20_/target/node/tmp
[INFO] Copying node binary from /tmp/build_ab545a20_/target/node/tmp/node-v12.16.3-linux-x64/bin/node to /tmp/build_ab545a20_/target/node/node
[INFO] Installed node locally.
[INFO] Installing npm version 6.14.4
[INFO] Unpacking /tmp/codon/tmp/cache/.m2/repository/com/github/eirslett/npm/6.14.4/npm-6.14.4.tar.gz into /tmp/build_ab545a20_/target/node/node_modules
[INFO] Installed npm locally.
[INFO]
[INFO] --- frontend-maven-plugin:1.6:npm (npm install) # shmot ---
[INFO] Running 'npm install' in /tmp/build_ab545a20_/front
[INFO]
[INFO] > core-js#2.6.12 postinstall /tmp/build_ab545a20_/front/node_modules/babel-runtime/node_modules/core-js
[INFO] > node -e "try{require('./postinstall')}catch(e){}"
[INFO]
[INFO] Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
[INFO]
[INFO] The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
[INFO] > https://opencollective.com/core-js
[INFO] > https://www.patreon.com/zloirock
[INFO]
[INFO] Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
[INFO]
[INFO]
[INFO] > core-js#3.8.2 postinstall /tmp/build_ab545a20_/front/node_modules/core-js
[INFO] > node -e "try{require('./postinstall')}catch(e){}"
[INFO]
[INFO]
[INFO] > core-js-pure#3.8.2 postinstall /tmp/build_ab545a20_/front/node_modules/core-js-pure
[INFO] > node -e "try{require('./postinstall')}catch(e){}"
[INFO]
[INFO]
[INFO] > ejs#2.7.4 postinstall /tmp/build_ab545a20_/front/node_modules/ejs
[INFO] > node ./postinstall.js
[INFO]
[INFO] Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)
[INFO]
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.3.1 (node_modules/fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
[ERROR]
[INFO] added 1926 packages from 760 contributors and audited 1929 packages in 45.11s
[INFO]
[INFO] 126 packages are looking for funding
[INFO] run `npm fund` for details
[INFO]
[INFO] found 0 vulnerabilities
[INFO]
[INFO]
[INFO] --- frontend-maven-plugin:1.6:npm (npm run build) # shmot ---
[INFO] Running 'npm run build' in /tmp/build_ab545a20_/front
[INFO]
[INFO] > front#0.1.0 build /tmp/build_ab545a20_/front
[INFO] > react-scripts build
[INFO]
[INFO] Creating an optimized production build...
[INFO] Compiled successfully.
[INFO]
[INFO] File sizes after gzip:
[INFO]
[INFO] 41.69 KB build/static/js/2.25b2f903.chunk.js
[INFO] 1.39 KB build/static/js/3.5c32b29a.chunk.js
[INFO] 1.16 KB build/static/js/runtime-main.f423ac52.js
[INFO] 802 B build/static/js/main.529d8860.chunk.js
[INFO] 531 B build/static/css/main.8c8b27cf.chunk.css
[INFO]
[INFO] The project was built assuming it is hosted at /.
[INFO] You can control this with the homepage field in your package.json.
[INFO]
[INFO] The build folder is ready to be deployed.
[INFO] You may serve it with a static server:
[INFO]
[INFO] npm install -g serve
[INFO] serve -s build
[INFO]
[INFO] Find out more about deployment here:
[INFO]
[INFO] https://cra.link/deployment
[INFO]
[INFO]
[INFO] --- maven-antrun-plugin:1.8:run (default) # shmot ---
[INFO] Executing tasks
main:
[copy] Copying 19 files to /tmp/build_ab545a20_/target/classes/public
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # shmot ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO] The encoding used to copy filtered properties files have not been set. This means that the same encoding will be used to copy filtered properties files as when copying other filtered resources. This might not be what you want! Run your build with --debug to see which files might be affected. Read more at https://maven.apache.org/plugins/maven-resources-plugin/examples/filtering-properties-files.html
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # shmot ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 15 source files to /tmp/build_ab545a20_/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # shmot ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /tmp/build_ab545a20_/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # shmot ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /tmp/build_ab545a20_/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # shmot ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:3.3.1:war (default-war) # shmot ---
[INFO] Packaging webapp
[INFO] Assembling webapp [shmot] in [/tmp/build_ab545a20_/target/shmot-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Building war: /tmp/build_ab545a20_/target/shmot-0.0.1-SNAPSHOT.war
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.1:repackage (repackage) # shmot ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # shmot ---
[INFO] Installing /tmp/build_ab545a20_/target/shmot-0.0.1-SNAPSHOT.war to /tmp/codon/tmp/cache/.m2/repository/com/khilkevichigor/shmot/0.0.1-SNAPSHOT/shmot-0.0.1-SNAPSHOT.war
[INFO] Installing /tmp/build_ab545a20_/pom.xml to /tmp/codon/tmp/cache/.m2/repository/com/khilkevichigor/shmot/0.0.1-SNAPSHOT/shmot-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:14 min
[INFO] Finished at: 2021-01-13T07:33:38Z
[INFO] ------------------------------------------------------------------------
-----> Discovering process types
Procfile declares types -> web
-----> Compressing...
Done: 221.8M
-----> Launching...
Released v22
https://shmoting.herokuapp.com/ deployed to Heroku
This is application logs from heroku:
2021-01-13T07:32:15.000000+00:00 app[api]: Build started by user khilkevichigor#gmail.com
2021-01-13T07:34:01.911760+00:00 app[api]: Deploy 1a70b985 by user khilkevichigor#gmail.com
2021-01-13T07:34:01.911760+00:00 app[api]: Release v22 created by user khilkevichigor#gmail.com
2021-01-13T07:34:03.105197+00:00 heroku[web.1]: State changed from crashed to starting
2021-01-13T07:34:12.000000+00:00 app[api]: Build succeeded
2021-01-13T07:34:24.571031+00:00 heroku[web.1]: Starting process with command `java -Dserver.port=49823 $JAVA_OPTS -jar target/shmot-0.0.1-SNAPSHOT.war`
2021-01-13T07:34:27.415308+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2021-01-13T07:34:27.420758+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2021-01-13T07:34:30.011053+00:00 app[web.1]:
2021-01-13T07:34:30.011193+00:00 app[web.1]: . ____ _ __ _ _
2021-01-13T07:34:30.011284+00:00 app[web.1]: /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
2021-01-13T07:34:30.011383+00:00 app[web.1]: ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2021-01-13T07:34:30.011477+00:00 app[web.1]: \\/ ___)| |_)| | | | | || (_| | ) ) ) )
2021-01-13T07:34:30.011570+00:00 app[web.1]: ' |____| .__|_| |_|_| |_\__, | / / / /
2021-01-13T07:34:30.011668+00:00 app[web.1]: =========|_|==============|___/=/_/_/_/
2021-01-13T07:34:30.013324+00:00 app[web.1]: :: Spring Boot :: (v2.4.1)
2021-01-13T07:34:30.013382+00:00 app[web.1]:
2021-01-13T07:34:30.433585+00:00 app[web.1]: 2021-01-13 07:34:30.428 INFO 4 --- [ main] c.khilkevichigor.shmot.ShmotApplication : Starting ShmotApplication v0.0.1-SNAPSHOT using Java 1.8.0_275-heroku on affa4dd6-bc17-41aa-b83b-7290ef507210 with PID 4 (/app/target/shmot-0.0.1-SNAPSHOT.war started by u5738 in /app)
2021-01-13T07:34:30.436511+00:00 app[web.1]: 2021-01-13 07:34:30.436 INFO 4 --- [ main] c.khilkevichigor.shmot.ShmotApplication : No active profile set, falling back to default profiles: default
2021-01-13T07:34:34.414783+00:00 app[web.1]: 2021-01-13 07:34:34.414 INFO 4 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-01-13T07:34:34.670946+00:00 app[web.1]: 2021-01-13 07:34:34.670 INFO 4 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 223 ms. Found 2 JPA repository interfaces.
2021-01-13T07:34:37.245660+00:00 app[web.1]: 2021-01-13 07:34:37.244 INFO 4 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 49823 (http)
2021-01-13T07:34:37.288439+00:00 app[web.1]: 2021-01-13 07:34:37.288 INFO 4 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-01-13T07:34:37.288893+00:00 app[web.1]: 2021-01-13 07:34:37.288 INFO 4 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.41]
2021-01-13T07:34:39.683441+00:00 app[web.1]: 2021-01-13 07:34:39.683 INFO 4 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-01-13T07:34:39.683661+00:00 app[web.1]: 2021-01-13 07:34:39.683 INFO 4 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 8934 ms
2021-01-13T07:34:40.337172+00:00 app[web.1]: 2021-01-13 07:34:40.334 INFO 4 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-01-13T07:34:40.486708+00:00 app[web.1]: 2021-01-13 07:34:40.485 INFO 4 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.25.Final
2021-01-13T07:34:41.135637+00:00 app[web.1]: 2021-01-13 07:34:41.135 INFO 4 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-01-13T07:34:41.407961+00:00 app[web.1]: 2021-01-13 07:34:41.407 INFO 4 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-01-13T07:34:42.079667+00:00 app[web.1]: 2021-01-13 07:34:42.079 INFO 4 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-01-13T07:34:42.171030+00:00 app[web.1]: 2021-01-13 07:34:42.170 INFO 4 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL10Dialect
2021-01-13T07:34:43.969250+00:00 app[web.1]: 2021-01-13 07:34:43.968 INFO 4 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-01-13T07:34:43.987686+00:00 app[web.1]: 2021-01-13 07:34:43.987 INFO 4 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-01-13T07:34:45.065217+00:00 app[web.1]: 2021-01-13 07:34:45.064 WARN 4 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-01-13T07:34:47.509625+00:00 app[web.1]: 2021-01-13 07:34:47.507 INFO 4 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#235a0c16, org.springframework.security.web.context.SecurityContextPersistenceFilter#3401a114, org.springframework.security.web.header.HeaderWriterFilter#73173f63, org.springframework.security.web.authentication.logout.LogoutFilter#319bc845, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#5e8ac0e1, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#4233e892, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#58ffcbd7, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#2b5f4d54, org.springframework.security.web.session.SessionManagementFilter#655ef322, org.springframework.security.web.access.ExceptionTranslationFilter#25e2ab5a, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#37ddb69a]
2021-01-13T07:34:47.944922+00:00 app[web.1]: 2021-01-13 07:34:47.944 INFO 4 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-01-13T07:34:48.163350+00:00 app[web.1]: 2021-01-13 07:34:48.163 INFO 4 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [public/index.html]
2021-01-13T07:34:48.933082+00:00 heroku[web.1]: State changed from starting to up
2021-01-13T07:34:48.717965+00:00 app[web.1]: 2021-01-13 07:34:48.716 INFO 4 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 49823 (http) with context path ''
2021-01-13T07:34:48.745993+00:00 app[web.1]: 2021-01-13 07:34:48.745 INFO 4 --- [ main] c.khilkevichigor.shmot.ShmotApplication : Started ShmotApplication in 19.827 seconds (JVM running for 21.325)
It feels like React isn't working!
Not exactly sure what is taking so long for npm to install on my EC2 instance, but here's the log output:
----------------------------------------
/var/log/eb-engine.log
----------------------------------------
2020/10/10 00:43:19.430098 [INFO] Downloading: bucket: elasticbeanstalk-us-east-1-665496786822,object: /resources/environments/e-779g33dt9k/_runtime/versions/manifest_1602290543372
2020/10/10 00:43:19.636192 [INFO] Download successful243bytes downloaded
2020/10/10 00:43:19.636422 [INFO] Trying to read and parse version manifest...
2020/10/10 00:43:19.636595 [INFO] Executing instruction: stopSqsd
2020/10/10 00:43:19.636602 [INFO] This is a web server environment instance, skip stop sqsd daemon...
2020/10/10 00:43:19.636606 [INFO] Executing instruction: StageApplication
2020/10/10 00:44:03.357499 [INFO] extracting
/opt/elasticbeanstalk/deployment/app_source_bundleto/var/app/staging/
2020/10/10 00:44:03.357569 [INFO] Running command /bin/sh -c /usr/bin/unzip -q -o
/opt/elasticbeanstalk/deployment/app_source_bundle -d /var/app/staging/
2020/10/10 00:44:03.972792 [INFO] finished extracting
/opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/ successfully
2020/10/10 00:44:03.973892 [INFO] Executing instruction: RunConfigDeployPreBuildHooks
2020/10/10 00:44:03.973905 [WARN] skipping hooks scripts under /opt/elasticbeanstalk/hooks/
2020/10/10 00:44:03.973917 [INFO] The dir .platform/confighooks/prebuild/ does not exist in the
application. Skipping this step...
2020/10/10 00:44:03.973922 [INFO] Executing instruction: Install customer specified node.js version
2020/10/10 00:44:03.973927 [INFO] installing specified nodejs version...
2020/10/10 00:44:03.974861 [INFO] validate the node.js version specified by customer...
2020/10/10 00:44:03.974877 [INFO] Nodejs 12.16.1 has already been installed, skipping
2020/10/10 00:44:03.974882 [INFO] Executing instruction: Use NPM to install dependencies
2020/10/10 00:44:03.974895 [INFO] use npm to install dependencies
2020/10/10 00:44:03.974932 [INFO] Running command /bin/sh -c npm config set jobs 1
2020/10/10 00:44:10.557446 [INFO] Running command /bin/sh -c npm --production install
2020/10/10 00:59:11.436998 [ERROR] An error occurred during execution of command [config-deploy] -
[Use NPM to install dependencies]. Stop running the command. Error: Command /bin/sh -c npm --
production install failed with error Command timed out after 900 seconds
I'm using the full CodePipeline, here is my buildspec.yml (spacing abbreviated):
# Buildspec version
version: 0.2
frontend:
phases:
preBuild:
commands:
- echo Installing NPM dependencies...
- npm ci
build:
commands:
- npm run-script build
artifacts:
baseDirectory: build
files:
- '**/*'
cache:
paths:
This should output a directory build for CodeDeploy, which uses this appspec.yml:
version: 0.0
os: linux
files:
- source: /
destination: /var/app/current
Turns out that Beanstalk likes to try to do things its own way, and I have it set to the Nodejs platform so it is going to try to run npm install and npm start at all costs.
I ended up disabling it through not including my package.json or package lock files in CodeBuild's artifact. This at least stopped it from trying to run its own NPM install. Not exactly efficient and I port all my node_modules over but it is zipped as an artifact from CodeBuild and sent to Beanstalk for deployment.
I just recently started using Amazon's AWS basic plan, I am using the AWS-Amplify for uploading react applications and I usually used yarn with create react-app. I am not sure if it has conflicts with the AWS tutorial using npm but I got it right and had success with the building and deployment. However, when I added the Auth functionalities it only worked on my local but the build fails on deployment. This is the error log:
2020-06-23T17:07:34.078Z [INFO]: Git SSH Key acquired
2020-06-23T17:07:34.155Z [INFO]: # Cloning repository: git#github.com:mav1283/amplifyapp.git
2020-06-23T17:07:34.273Z [INFO]: Agent pid 131
2020-06-23T17:07:34.329Z [INFO]: Identity added: /root/.ssh/git_rsa (/root/.ssh/git_rsa)
2020-06-23T17:07:34.558Z [INFO]: Cloning into 'amplifyapp'...
2020-06-23T17:07:35.697Z [INFO]: Warning: Permanently added the RSA host key for IP address '13.229.188.59' to the list of known hosts.
2020-06-23T17:07:38.298Z [INFO]: # Switching to commit: 2d93cd9fca8f302a1390bce33985acccf97a8263
2020-06-23T17:07:38.388Z [INFO]: Note: checking out '2d93cd9fca8f302a1390bce33985acccf97a8263'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 2d93cd9 add auth
2020-06-23T17:07:38.389Z [INFO]: # Checking for Git submodules at: /codebuild/output/src043707224/src/amplifyapp/.gitmodules
2020-06-23T17:07:38.411Z [INFO]: # Retrieving cache...
2020-06-23T17:07:40.086Z [INFO]: # Extracting cache...
2020-06-23T17:07:43.479Z [INFO]: # Extraction completed
2020-06-23T17:07:43.604Z [INFO]: # Retrieving environment cache...
2020-06-23T17:07:43.642Z [INFO]: # Retrieved environment cache
2020-06-23T17:08:17.476Z [INFO]: ## Starting Frontend Build
# Starting phase: preBuild
# Executing command: yarn install
2020-06-23T17:08:18.203Z [INFO]: yarn install v1.16.0
2020-06-23T17:08:18.305Z [INFO]: [1/4] Resolving packages...
2020-06-23T17:08:18.838Z [INFO]: [2/4] Fetching packages...
2020-06-23T17:08:48.710Z [INFO]: info fsevents#2.1.2: The platform "linux" is incompatible with this module.
2020-06-23T17:08:48.712Z [INFO]: info "fsevents#2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
2020-06-23T17:08:48.719Z [INFO]: info fsevents#1.2.13: The platform "linux" is incompatible with this module.
2020-06-23T17:08:48.723Z [INFO]: info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.1.3: The platform "linux" is incompatible with this module.
info "fsevents#2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
2020-06-23T17:08:48.728Z [INFO]: [3/4] Linking dependencies...
2020-06-23T17:08:48.732Z [WARNING]: warning "#aws-amplify/ui-react > #aws-amplify/ui-components#0.5.2" has unmet peer dependency "#aws-amplify/auth#^2.1.5".
warning "#aws-amplify/ui-react > #aws-amplify/ui-components#0.5.2" has unmet peer dependency "#aws-amplify/core#^2.2.4".
warning "#aws-amplify/ui-react > #aws-amplify/ui-components#0.5.2" has unmet peer dependency "#aws-amplify/xr#^1.1.5".
warning " > #testing-library/user-event#7.2.1" has unmet peer dependency "#testing-library/dom#>=5".
2020-06-23T17:08:48.734Z [WARNING]: warning "aws-amplify > #aws-amplify/api#3.1.17" has incorrect peer dependency "#aws-amplify/pubsub#^2.1.1".
warning "aws-amplify > #aws-amplify/datastore#2.2.4" has unmet peer dependency "#react-native-community/netinfo#^5.5.0".
warning "aws-amplify > #aws-amplify/api > #aws-amplify/api-graphql#1.1.0" has incorrect peer dependency "#aws-amplify/pubsub#^2.1.1".
2020-06-23T17:08:48.736Z [WARNING]: warning "react-scripts > #typescript-eslint/eslint-plugin > tsutils#3.17.1" has unmet peer dependency "typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
2020-06-23T17:08:56.100Z [INFO]: [4/4] Building fresh packages...
2020-06-23T17:08:57.025Z [INFO]: Done in 38.83s.
2020-06-23T17:08:57.047Z [INFO]: # Completed phase: preBuild
# Starting phase: build
# Executing command: yarn run build
2020-06-23T17:08:57.210Z [INFO]: yarn run v1.16.0
2020-06-23T17:08:57.237Z [INFO]: $ react-scripts build
2020-06-23T17:08:58.125Z [INFO]: Creating an optimized production build...
2020-06-23T17:08:59.577Z [INFO]: Failed to compile.
2020-06-23T17:08:59.579Z [INFO]: ./src/index.js
Cannot find file './aws-exports' in './src'.
2020-06-23T17:08:59.596Z [WARNING]: error Command failed with exit code 1.
2020-06-23T17:08:59.597Z [INFO]: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2020-06-23T17:08:59.602Z [ERROR]: !!! Build failed
2020-06-23T17:08:59.677Z [ERROR]: !!! Non-Zero Exit Code detected
2020-06-23T17:08:59.677Z [INFO]: # Starting environment caching...
2020-06-23T17:08:59.678Z [INFO]: # Environment caching completed
Terminating logging...
Creating the service role and changing the CLI version worked for me. If you do one and not the other you will not solve the problem. So create the service role and update the CLi version in the advanced settings to latest. That will work like magic.
For security reasons aws-exports.js is added to git ignore by default on amplify projects. This file is generated when you run the amplify push command.
backend:
phases:
# IMPORTANT - Please verify your build commands
build:
commands:
- '# Execute Amplify CLI with the helper script'
- amplifyPush --simple
Make sure you have amplifyPush --simple on your Build Settings -> amplify.yml file so you generate aws-exports on your amplify builds
I'm new to react and webpack. Maven seems to be unable to process my css files. Running mvn install has a syntax error unexpected token on the first character of my CSS file. Does it have to do with this warning I'm getting?
[WARNING] npm WARN webpack-cli#2.0.14 requires a peer of webpack#^4.0.0 but none was installed.
I tried updating webpack to that version 4.0.0 but that gave me babel-loader issues. I'm new to tracking down maven dependencies. Can anyone take at my package.json config and maven output? Any help would be appreciated.
Here's my package.json:
{
"name": "misdeal",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^15.3.2",
"react-dom": "^15.3.2",
"rest": "^1.3.1",
"webpack": "^1.12.2"
},
"scripts": {
"watch": "webpack --watch -d"
},
"devDependencies": {
"babel-core": "^6.18.2",
"babel-loader": "^6.2.7",
"babel-polyfill": "^6.16.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"webpack-cli": "^2.0.14"
}
}
Here's the maven install output:
[INFO] --- frontend-maven-plugin:1.2:install-node-and-npm (install node and npm) # misdeal ---
[INFO] Installing node version v4.4.5
[INFO] Copying node binary from C:\Users\btillinghast\.m2\repository\com\github\eirslett\node\4.4.5\node-4.4.5-win-x64.exe to C:\Users\btillinghast\git\misdeal\target\node\node.exe
[INFO] Installed node locally.
[INFO] Installing npm version 3.9.2
[INFO] Unpacking C:\Users\btillinghast\.m2\repository\com\github\eirslett\npm\3.9.2\npm-3.9.2.tar.gz into C:\Users\btillinghast\git\misdeal\target\node\node_modules
[INFO] Installed npm locally.
[INFO]
[INFO] --- frontend-maven-plugin:1.2:npm (npm install) # misdeal ---
[INFO] Running 'npm install' in C:\Users\btillinghast\git\misdeal
[WARNING] npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
[WARNING] npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.1.3
[WARNING] npm WARN webpack-cli#2.0.14 requires a peer of webpack#^4.0.0 but none was installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.2:webpack (webpack build) # misdeal ---
[INFO] Running 'webpack.js ' in C:\Users\btillinghast\git\misdeal
[INFO] Hash: 6c98a449ae4f6374613a
[INFO] Version: webpack 1.15.0
[INFO] Time: 1332ms
[INFO] Asset Size Chunks Chunk Names
[INFO] ./src/main/resources/static/built/bundle.js 756 kB 0 [emitted] main
[INFO] ./src/main/resources/static/built/bundle.js.map 880 kB 0 [emitted] main
[INFO] + 187 hidden modules
[INFO]
[INFO] ERROR in ./src/main/resources/static/App.css
[INFO] Module build failed: SyntaxError: C:/Users/btillinghast/git/misdeal/src/main/resources/static/App.css: Unexpected token (1:0)
[INFO]
[INFO] > 1 | .App {
[INFO] | ^
[INFO] 2 | text-align: center;
[INFO] 3 | }
[INFO] 4 |
[INFO]
[INFO] # ./src/main/js/containers/App.js 13:0-41
You need to update Webpack, the version you have is outdated, the current version is 4.5.0 the version you have installed is 1.12.2 and Webpack CLI requires at least version 4.0.0
Try npm update -g webpack
If that does not work
Try npm install --save-dev webpack
or with Yarn
Try yarn add webpack --dev