Code Monkey home page Code Monkey logo

docker's People

Contributors

supremko avatar

Watchers

 avatar  avatar

docker's Issues

Не добавляются данные в базу app и не запускается контейнер после краша

Система: Windows 10 Pro 1903 с Docker Desktop

  1. Открыл IDEA
  2. Прописал необходимые настройки в application.properties и docker.compose.yml
  3. Поднял postgres через docker-compose up -d
  4. Проверил доступность postgres и наличие базы app командой docker-compose exec psql -U app -W
  5. Запустил db-api.jar командой java -jar
  6. Получил ошибку
 :: Spring Boot ::        (v2.2.1.RELEASE)

2019-12-24 21:21:27.245  INFO 3812 --- [           main] ru.netology.dbapi.DbApiApplication       : Starting DbApiApplication v0.0.1-SNAPSHOT on
DESKTOP-0IP09JQ with PID 3812 (D:\git\docker\db-api.jar started by supre in D:\git\docker)
2019-12-24 21:21:27.249  INFO 3812 --- [           main] ru.netology.dbapi.DbApiApplication       : No active profile set, falling back to defaul
t profiles: default
2019-12-24 21:21:27.898  INFO 3812 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEF
AULT mode.
2019-12-24 21:21:27.970  INFO 3812 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 6
0ms. Found 1 repository interfaces.
2019-12-24 21:21:28.321  INFO 3812 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotat
ion.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not
eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-24 21:21:28.901  INFO 3812 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 9999 (http)
2019-12-24 21:21:28.914  INFO 3812 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-12-24 21:21:28.914  INFO 3812 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.2
7]
2019-12-24 21:21:29.575  INFO 3812 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationCo
ntext
2019-12-24 21:21:29.575  INFO 3812 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization co
mpleted in 2266 ms
2019-12-24 21:21:29.779  INFO 3812 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [na
me: default]
2019-12-24 21:21:29.872  INFO 3812 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.4.8.Final}
2019-12-24 21:21:30.123  INFO 3812 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5
.1.0.Final}
2019-12-24 21:21:30.245  INFO 3812 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2019-12-24 21:21:40.285 ERROR 3812 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initiali
zation.

org.postgresql.util.PSQLException: ╬°шсър яЁш яюя√Єъх яюфёюхфшэхэш .


2019-12-24 21:21:40.288  WARN 3812 --- [           main] o.h.e.j.e.i.JdbcEnvironmentInitiator     : HHH000342: Could not obtain connection to que
ry metadata : ╬°шсър яЁш яюя√Єъх яюфёюхфшэхэш .
2019-12-24 21:21:40.292  WARN 3812 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initiali
zation - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory
' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method fail
ed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnv
ironment]
2019-12-24 21:21:40.295  INFO 3812 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2019-12-24 21:21:40.307  INFO 3812 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-12-24 21:21:40.309 ERROR 3812 --- [           main] o.s.boot.SpringApplication   
  1. Произошел краш системы
  2. Попытался запустить контейнер с postgres повторно
  3. Получил ошибку
ERROR: for postgres  Cannot start service postgres: driver failed programming external connectivity on endpoint docker_postgres_1 (be19c182ce25db
05b48276ccb4ce1813f9a111d9e12fc5ee88aba60d7cb940b9): Error starting userland proxy: listen tcp 0.0.0.0:8080: bind: Only one usage of each socket
address (protocol/network address/port) is normally permitted.
ERROR: Encountered errors while bringing up the project.

Ожидаемый результат:
Данные из jar файла находятся в базе app и postgres возможно перезапустить

Фактический результат:
postgres не запускается, данных в базе нет.

Не запускается docker-compose

Система Windows 10 Pro 1903
При попытке запуска - docker-compose up -d отображается ошибка
image
Попытка перенести проект на диск С или запустить в режиме администратора никак не помогли.
Docker Desktop при этом установлен.

Не добавляются данные в базу app

Нашел IP адрес контейнера

D:\git\docker>docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                              NAMES
59d4892b4fc3        postgres:12.1       "docker-entrypoint.s…"   47 hours ago        Up 47 hours         5432/tcp, 0.0.0.0:8080->8080/tcp   docke
r_postgres_1
D:\git\docker>docker inspect -f "{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" 59d4892b4fc3
/docker_postgres_1 - 172.19.0.2

Заменил с localhost на этот адрес, запустил jar файл и получил такую же ошибку

 :: Spring Boot ::        (v2.2.1.RELEASE)

2019-12-24 21:21:27.245  INFO 3812 --- [           main] ru.netology.dbapi.DbApiApplication       : Starting DbApiApplication v0.0.1-SNAPSHOT on
DESKTOP-0IP09JQ with PID 3812 (D:\git\docker\db-api.jar started by supre in D:\git\docker)
2019-12-24 21:21:27.249  INFO 3812 --- [           main] ru.netology.dbapi.DbApiApplication       : No active profile set, falling back to defaul
t profiles: default
2019-12-24 21:21:27.898  INFO 3812 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEF
AULT mode.
2019-12-24 21:21:27.970  INFO 3812 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 6
0ms. Found 1 repository interfaces.
2019-12-24 21:21:28.321  INFO 3812 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotat
ion.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not
eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-24 21:21:28.901  INFO 3812 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 9999 (http)
2019-12-24 21:21:28.914  INFO 3812 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-12-24 21:21:28.914  INFO 3812 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.2
7]
2019-12-24 21:21:29.575  INFO 3812 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationCo
ntext
2019-12-24 21:21:29.575  INFO 3812 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization co
mpleted in 2266 ms
2019-12-24 21:21:29.779  INFO 3812 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [na
me: default]
2019-12-24 21:21:29.872  INFO 3812 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.4.8.Final}
2019-12-24 21:21:30.123  INFO 3812 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5
.1.0.Final}
2019-12-24 21:21:30.245  INFO 3812 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2019-12-24 21:21:40.285 ERROR 3812 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initiali
zation.

org.postgresql.util.PSQLException: ╬°шсър яЁш яюя√Єъх яюфёюхфшэхэш .


2019-12-24 21:21:40.288  WARN 3812 --- [           main] o.h.e.j.e.i.JdbcEnvironmentInitiator     : HHH000342: Could not obtain connection to que
ry metadata : ╬°шсър яЁш яюя√Єъх яюфёюхфшэхэш .
2019-12-24 21:21:40.292  WARN 3812 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initiali
zation - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory
' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method fail
ed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnv
ironment]
2019-12-24 21:21:40.295  INFO 3812 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2019-12-24 21:21:40.307  INFO 3812 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-12-24 21:21:40.309 ERROR 3812 --- [           main] o.s.boot.SpringApplication               : Application run failed

В базе ничего не появилось.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.