Я получил эту ошибку, когда я пытался открыть свое приложение heroku, я обнаружил, что проблема заключается в тайм-ауте, поэтому я попытался добавить server.servlet.session.timeout, но это определенно не является решением.
2020-02-10T11:36:21.190583+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=wildmotorstore.herokuapp.com request_id=fc77139b- 0a0a-4230-92d5-6074a54c8e6f fwd="37.172.195.65" dyno=web.1 connect=0ms service=16383ms status=503 bytes=0 protocol=https
2020-02-10T11:36:21.534161+00:00 heroku[web.1]: State changed from up to crashed
2020-02-10T11:36:21.509917+00:00 heroku[web.1]: Process exited with status 1
2020-02-10T11:36:22.414590+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=wildmotorstore.herokuapp.com request_id=97f82516-5206-4e49-b240-67202f665480 fwd="37.172.195.65" dyno= connect= service= status=503 bytes= protocol=https
это мои application.properties, я думаю, что ошибка где-то здесь
spring.datasource.url=mysql://url
spring.datasource.username=user
spring.datasource.password=pass
spring.datasource.tomcat.test-while-idle=true
spring.datasource.tomcat.validation-query=SELECT 1
server.servlet.session.timeout=120
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jmx.unique-names=true
management.endpoints.jmx.domain=package
spring.servlet.multipart.max-file-size=128MB
spring.servlet.multipart.max-request-size=128MB
spring.servlet.multipart.enabled=true
spring.servlet.multipart.file-size-threshold=2KB
file.upload-dir=/var/www/myfolder
Подробнее
2020-02-11T19:04:20.659882+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2020-02-11T19:04:20.659908+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2020-02-11T19:04:20.659932+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-02-11T19:04:20.659963+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2020-02-11T19:04:20.659992+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2020-02-11T19:04:20.660021+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2020-02-11T19:04:20.660063+00:00 app[web.1]: ... 16 more
2020-02-11T19:04:20.660140+00:00 app[web.1]: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shopController' defined in file [/app/target/tomcat.28370/webapps/expanded/WEB-INF/classes/com/wildcodeschool/wildmotorstore/controller/ShopController.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.wildcodeschool.wildmotorstore.controller.ShopController]: Constructor threw exception; nested exception is java.lang.RuntimeException: Could not create the directory where the uploaded files will be stored.
2020-02-11T19:04:20.660171+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:314)
2020-02-11T19:04:20.660263+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:295)
2020-02-11T19:04:20.660303+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358)
2020-02-11T19:04:20.660338+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204)
2020-02-11T19:04:20.660371+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
2020-02-11T19:04:20.660404+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
2020-02-11T19:04:20.660443+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
2020-02-11T19:04:20.660470+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
2020-02-11T19:04:20.660500+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
2020-02-11T19:04:20.660527+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
2020-02-11T19:04:20.660560+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
2020-02-11T19:04:20.660622+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
2020-02-11T19:04:20.660626+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
2020-02-11T19:04:20.660660+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
2020-02-11T19:04:20.660694+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
2020-02-11T19:04:20.660719+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
2020-02-11T19:04:20.660760+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
2020-02-11T19:04:20.660937+00:00 app[web.1]: at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:152)
2020-02-11T19:04:20.661006+00:00 app[web.1]: at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:132)
2020-02-11T19:04:20.661087+00:00 app[web.1]: at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:92)
2020-02-11T19:04:20.661126+00:00 app[web.1]: at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
2020-02-11T19:04:20.661155+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)
2020-02-11T19:04:20.661184+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2020-02-11T19:04:20.661211+00:00 app[web.1]: ... 22 more
2020-02-11T19:04:20.661303+00:00 app[web.1]: Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.wildcodeschool.wildmotorstore.controller.ShopController]: Constructor threw exception; nested exception is java.lang.RuntimeException: Could not create the directory where the uploaded files will be stored.
2020-02-11T19:04:20.661339+00:00 app[web.1]: at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:216)
2020-02-11T19:04:20.661368+00:00 app[web.1]: at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
2020-02-11T19:04:20.661419+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:310)
2020-02-11T19:04:20.661467+00:00 app[web.1]: ... 44 more
2020-02-11T19:04:20.661563+00:00 app[web.1]: Caused by: java.lang.RuntimeException: Could not create the directory where the uploaded files will be stored.
2020-02-11T19:04:20.661624+00:00 app[web.1]: at com.wildcodeschool.wildmotorstore.controller.ShopController.<init>(ShopController.java:59)
2020-02-11T19:04:20.661683+00:00 app[web.1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2020-02-11T19:04:20.661736+00:00 app[web.1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
2020-02-11T19:04:20.661796+00:00 app[web.1]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2020-02-11T19:04:20.661832+00:00 app[web.1]: at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
2020-02-11T19:04:20.661859+00:00 app[web.1]: at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:203)
2020-02-11T19:04:20.661893+00:00 app[web.1]: ... 46 more
2020-02-11T19:04:20.661959+00:00 app[web.1]: Caused by: java.nio.file.FileSystemException: /var/www: Read-only file system
2020-02-11T19:04:20.661994+00:00 app[web.1]: at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
2020-02-11T19:04:20.662036+00:00 app[web.1]: at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
2020-02-11T19:04:20.662074+00:00 app[web.1]: at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
2020-02-11T19:04:20.662108+00:00 app[web.1]: at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
2020-02-11T19:04:20.662142+00:00 app[web.1]: at java.nio.file.Files.createDirectory(Files.java:674)
2020-02-11T19:04:20.662179+00:00 app[web.1]: at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
2020-02-11T19:04:20.662217+00:00 app[web.1]: at java.nio.file.Files.createDirectories(Files.java:767)
2020-02-11T19:04:20.662240+00:00 app[web.1]: at com.wildcodeschool.wildmotorstore.controller.ShopController.<init>(ShopController.java:57)
2020-02-11T19:04:20.662274+00:00 app[web.1]: ... 51 more
2020-02-11T19:04:20.827728+00:00 heroku[web.1]: State changed from up to crashed
2020-02-11T19:04:20.807037+00:00 heroku[web.1]: Process exited with status 1
2020-02-11T19:06:45.000000+00:00 app[api]: Build started by user
2020-02-11T19:07:18.592316+00:00 heroku[web.1]: State changed from crashed to starting
2020-02-11T19:07:17.852341+00:00 app[api]: Release v29 created by user
2020-02-11T19:07:17.852341+00:00 app[api]: Deploy 78ada0d4 by user
2020-02-11T19:07:25.238441+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -jar target/dependency/webapp-runner.jar $WEBAPP_RUNNER_OPTS --port 37172 target/wildmotorstore-1.0.war`
2020-02-11T19:07:27.263692+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-11T19:07:27.248563+00:00 heroku[web.1]: Process exited with status 1
2020-02-11T19:07:27.186186+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-02-11T19:07:27.190505+00:00 app[web.1]: Error: Unable to access jarfile target/dependency/webapp-runner.jar
2020-02-11T19:07:27.000000+00:00 app[api]: Build succeeded
2020-02-11T19:07:34.913378+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=wildmotorstore.herokuapp.com request_id=75d2507e-0fc0-4320-8554-55e27aac1799 fwd="37.170.153.195" dyno= connect= service= status=503 bytes= protocol=https
2020-02-11T19:07:36.099444+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=wildmotorstore.herokuapp.com request_id=e1aeed6e-c4d8-4f82-86e1-1b3d0722705c fwd="37.170.153.195" dyno= connect= service= status=503 bytes= protocol=https
2020-02-11T19:08:46.000000+00:00 app[api]: Build started by user
2020-02-11T19:09:19.069321+00:00 heroku[web.1]: State changed from crashed to starting
2020-02-11T19:09:18.895242+00:00 app[api]: Release v30 created by user
2020-02-11T19:09:18.895242+00:00 app[api]: Deploy ea43862c by user
2020-02-11T19:09:25.804989+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -jar target/dependency/webapp-runner.jar $WEBAPP_RUNNER_OPTS --port 5530 target/wildmotorstore-1.0.war`
2020-02-11T19:09:27.854925+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-11T19:09:27.785800+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-02-11T19:09:27.788260+00:00 app[web.1]: Error: Unable to access jarfile target/dependency/webapp-runner.jar
2020-02-11T19:09:27.837512+00:00 heroku[web.1]: Process exited with status 1
2020-02-11T19:09:30.000000+00:00 app[api]: Build succeeded
2020-02-11T19:09:38.279371+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=wildmotorstore.herokuapp.com request_id=3eade638-45f4-461b-b375-04f7006000f1 fwd="37.170.153.195" dyno= connect= service= status=503 bytes= protocol=https
2020-02-11T19:09:38.958341+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=wildmotorstore.herokuapp.com request_id=8341e048-4582-4a11-be4c-199252688381 fwd="37.170.153.195" dyno= connect= service= status=503 bytes= protocol=https
2020-02-11T19:18:46.907802+00:00 heroku[web.1]: State changed from crashed to starting
2020-02-11T19:18:53.278965+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -jar target/dependency/webapp-runner.jar $WEBAPP_RUNNER_OPTS --port 41978 target/wildmotorstore-1.0.war`
2020-02-11T19:18:54.990442+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-11T19:18:54.938372+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-02-11T19:18:54.939704+00:00 app[web.1]: Error: Unable to access jarfile target/dependency/webapp-runner.jar
2020-02-11T19:18:54.973120+00:00 heroku[web.1]: Process exited with status 1
2020-02-11T20:04:59.202233+00:00 heroku[web.1]: State changed from crashed to starting
2020-02-11T20:05:06.388914+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -jar target/dependency/webapp-runner.jar $WEBAPP_RUNNER_OPTS --port 20075 target/wildmotorstore-1.0.war`
2020-02-11T20:05:08.807781+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-11T20:05:08.736829+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-02-11T20:05:08.738152+00:00 app[web.1]: Error: Unable to access jarfile target/dependency/webapp-runner.jar
2020-02-11T20:05:08.786421+00:00 heroku[web.1]: Process exited with status 1
2020-02-11T20:23:46.000000+00:00 app[api]: Build started by user
2020-02-11T20:24:18.173936+00:00 heroku[web.1]: State changed from crashed to down
2020-02-11T20:24:18.095071+00:00 app[api]: Deploy 981654fb by user
2020-02-11T20:24:18.095071+00:00 app[api]: Release v31 created by user
2020-02-11T20:24:28.000000+00:00 app[api]: Build succeeded
2020-02-11T20:24:37.206719+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=wildmotorstore.herokuapp.com request_id=6e3e2591-d24c-4586-afa7-b1cb978f01bc fwd="37.170.153.195" dyno= connect= service= status=503 bytes= protocol=https
2020-02-11T20:24:37.847398+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=wildmotorstore.herokuapp.com request_id=e08c0356-3736-4a86-bb96-2158650bc8f0 fwd="37.170.153.195" dyno= connect= service= status=503 bytes= protocol=https
Я не знаю, если проблема в базу данных, я пытался с postgre DDB, но у меня все еще есть та же проблема. Может быть, это мои зависимости. На местном это хорошо работает ?