rxue / dictionary

Practice in Java EE
1 stars 0 forks source link

error when sourcing the run_web.sh #44

Closed Chester-CH closed 1 year ago

Chester-CH commented 1 year ago

ERROR: for 00423d944123_dictionary-web Cannot start service web: driver failed programming external connectivity on endpoint dictionary-web (19d25c5278829a4ccd74f3d9e40fe784ce574bc812c032cd77ebcf290a69a2f9): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use

ERROR: for web Cannot start service web: driver failed programming external connectivity on endpoint dictionary-web (19d25c5278829a4ccd74f3d9e40fe784ce574bc812c032cd77ebcf290a69a2f9): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use ERROR: Encountered errors while bringing up the project. Attaching to dictionary-web, 00423d944123_dictionary-web 00423d944123_dictionary-web exited with code 128 dictionary-web exited with code 128

rxue commented 1 year ago

try command docker ps and paste the output here

Chester-CH commented 1 year ago
BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.216 s
[INFO] Finished at: 2022-09-26T01:18:19+03:00
[INFO] ------------------------------------------------------------------------
Removing dictionary-web
Building web
Step 1/5 : FROM jboss/wildfly:latest
---> 856694040847
Step 2/5 : COPY target/dictionary.war /opt/jboss/wildfly/standalone/deployments/
---> 70f024ffe366
Step 3/5 : COPY docker_config/standalone.xml /opt/jboss/wildfly/standalone/configuration/
---> 2264a7108a29
Step 4/5 : COPY docker_config/bin/standalone.conf /opt/jboss/wildfly/bin/
---> 8274937aa33f
Step 5/5 : ENTRYPOINT ["/opt/jboss/wildfly/bin/standalone.sh", "-c", "standalone.xml", "-Djboss.http.port=80", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
---> Running in a70543061e36
Removing intermediate container a70543061e36
---> c08f60a10de4

Successfully built c08f60a10de4
Successfully tagged docker_web:latest
Recreating 00423d944123_dictionary-web ...
Recreating 00423d944123_dictionary-web ... error

ERROR: for 00423d944123_dictionary-web Cannot start service web: driver failed programming external connectivity on endpoint dictionary-web (e18838fea853b1f10e5ee208b3c093634b107f4cf032bdf924b93af75d55447b): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use

ERROR: for web Cannot start service web: driver failed programming external connectivity on endpoint dictionary-web (e18838fea853b1f10e5ee208b3c093634b107f4cf032bdf924b93af75d55447b): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
ERROR: Encountered errors while bringing up the project.
Attaching to dictionary-web, 00423d944123_dictionary-web
dictionary-web exited with code 128
00423d944123_dictionary-web exited with code 128

then I checked the containers by using docker ps, like you have suggested, but there is no container found:/

rxue commented 1 year ago

type this command sudo netstat -tlenp | grep 80 and paste the output here. NOTE! sudo needed here. You could paste the output here also. Then you might be able to resolve this error yourself

Reference: https://explainshell.com/explain?cmd=netstat+-tlenp

Chester-CH commented 1 year ago

tcp6 0 0 :::80 :::* LISTEN 0 25574 1337/apache2 here is the output

Chester-CH commented 1 year ago

I killed first the process by using this command sudo lsof -t -i tcp:80 -s tcp:listen | sudo xargs kill. But the error still occurs after killing all the processes.

rxue commented 1 year ago

the same error?

just use the same command sudo netstat -tlenp | grep 80 to make sure that this has no output

Chester-CH commented 1 year ago

ofc I checked that there is no process going

The error [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.001 s [INFO] Finished at: 2022-09-26T23:49:55+03:00 [INFO] ------------------------------------------------------------------------ Removing dictionary-web Building web Step 1/5 : FROM jboss/wildfly:latest ---> 856694040847 Step 2/5 : COPY target/dictionary.war /opt/jboss/wildfly/standalone/deployments/ ---> a6a869d0abf5 Step 3/5 : COPY docker_config/standalone.xml /opt/jboss/wildfly/standalone/configuration/ ---> 19d2496c849d Step 4/5 : COPY docker_config/bin/standalone.conf /opt/jboss/wildfly/bin/ ---> a14864bb585a Step 5/5 : ENTRYPOINT ["/opt/jboss/wildfly/bin/standalone.sh", "-c", "standalone.xml", "-Djboss.http.port=80", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"] ---> Running in e4712097f2a5 Removing intermediate container e4712097f2a5 ---> 9e9a64ea96f4

Successfully built 9e9a64ea96f4 Successfully tagged docker_web:latest Recreating 00423d944123_dictionary-web ... error

ERROR: for 00423d944123_dictionary-web Cannot start service web: cgroups: cgroup mountpoint does not exist: unknown

ERROR: for web Cannot start service web: cgroups: cgroup mountpoint does not exist: unknown ERROR: Encountered errors while bringing up the project. Attaching to dictionary-web, 00423d944123_dictionary-web 00423d944123_dictionary-web exited with code 128 dictionary-web exited with code 128

rxue commented 1 year ago

it is different error. I recommend you to resolve this error yourself. You learn again. I had the same error when using the Docker at the beginning

Chester-CH commented 1 year ago

[INFO] Scanning for projects... [INFO] [INFO] ---------------------------< rx:dictionary >---------------------------- [INFO] Building Dictionary in Web 1.0-SNAPSHOT [INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ dictionary --- [INFO] Deleting /home/chen/Desktop/dictionary/docker/../web/target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ dictionary --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ dictionary --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 25 source files to /home/chen/Desktop/dictionary/docker/../web/target/classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ dictionary --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /home/chen/Desktop/dictionary/docker/../web/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ dictionary --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.16:test (default-test) @ dictionary --- [INFO] Tests are skipped. [INFO] [INFO] --- maven-war-plugin:2.5:war (default-war) @ dictionary --- WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.thoughtworks.xstream.converters.collections.TreeMapConverter (file:/home/chen/.m2/repository/com/thoughtworks/xstream/xstream/1.4.4/xstream-1.4.4.jar) to field java.util.TreeMap.comparator WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.converters.collections.TreeMapConverter WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [INFO] Packaging webapp [INFO] Assembling webapp [dictionary] in [/home/chen/Desktop/dictionary/docker/../web/target/dictionary] [INFO] Processing war project [INFO] Copying webapp resources [/home/chen/Desktop/dictionary/docker/../web/src/main/webapp] [INFO] Webapp assembled in [45 msecs] [INFO] Building war: /home/chen/Desktop/dictionary/docker/../web/target/dictionary.war [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.258 s [INFO] Finished at: 2022-09-27T16:39:27+03:00 [INFO] ------------------------------------------------------------------------ Traceback (most recent call last): File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/connectionpool.py", line 710, in urlopen chunked=chunked, File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/connectionpool.py", line 398, in _make_request conn.request(method, url, **httplib_request_kw) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1285, in request self._send_request(method, url, body, headers, encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1331, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1046, in _send_output self.send(msg) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 984, in send self.connect() File "/snap/docker/1779/lib/python3.6/site-packages/docker/transport/unixconn.py", line 30, in connect sock.connect(self.unix_socket) PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/snap/docker/1779/lib/python3.6/site-packages/requests/adapters.py", line 450, in send timeout=timeout File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/connectionpool.py", line 786, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/connectionpool.py", line 710, in urlopen chunked=chunked, File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/connectionpool.py", line 398, in _make_request conn.request(method, url, **httplib_request_kw) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1285, in request self._send_request(method, url, body, headers, encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1331, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1046, in _send_output self.send(msg) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 984, in send self.connect() File "/snap/docker/1779/lib/python3.6/site-packages/docker/transport/unixconn.py", line 30, in connect sock.connect(self.unix_socket) urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/snap/docker/1779/lib/python3.6/site-packages/docker/api/client.py", line 214, in _retrieve_server_version return self.version(api_version=False)["ApiVersion"] File "/snap/docker/1779/lib/python3.6/site-packages/docker/api/daemon.py", line 181, in version return self._result(self._get(url), json=True) File "/snap/docker/1779/lib/python3.6/site-packages/docker/utils/decorators.py", line 46, in inner return f(self, *args, kwargs) File "/snap/docker/1779/lib/python3.6/site-packages/docker/api/client.py", line 237, in _get return self.get(url, self._set_request_timeout(kwargs)) File "/snap/docker/1779/lib/python3.6/site-packages/requests/sessions.py", line 542, in get return self.request('GET', url, kwargs) File "/snap/docker/1779/lib/python3.6/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, send_kwargs) File "/snap/docker/1779/lib/python3.6/site-packages/requests/sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "/snap/docker/1779/lib/python3.6/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/snap/docker/1779/bin/docker-compose", line 33, in sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')()) File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/main.py", line 81, in main command_func() File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/main.py", line 200, in perform_command project = project_from_options('.', options) File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/command.py", line 70, in project_from_options enabled_profiles=get_profiles_from_options(options, environment) File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/command.py", line 153, in get_project verbose=verbose, version=api_version, context=context, environment=environment File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/docker_client.py", line 43, in get_client environment=environment, tls_version=get_tls_version(environment) File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/docker_client.py", line 170, in docker_client client = APIClient(use_ssh_client=not use_paramiko_ssh, kwargs) File "/snap/docker/1779/lib/python3.6/site-packages/docker/api/client.py", line 197, in init self._version = self._retrieve_server_version() File "/snap/docker/1779/lib/python3.6/site-packages/docker/api/client.py", line 222, in _retrieve_server_version f'Error while fetching server API version: {e}' docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied')) Traceback (most recent call last): File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/connectionpool.py", line 710, in urlopen chunked=chunked, File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/connectionpool.py", line 398, in _make_request conn.request(method, url, httplib_request_kw) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1285, in request self._send_request(method, url, body, headers, encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1331, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1046, in _send_output self.send(msg) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 984, in send self.connect() File "/snap/docker/1779/lib/python3.6/site-packages/docker/transport/unixconn.py", line 30, in connect sock.connect(self.unix_socket) PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/snap/docker/1779/lib/python3.6/site-packages/requests/adapters.py", line 450, in send timeout=timeout File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/connectionpool.py", line 786, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/connectionpool.py", line 710, in urlopen chunked=chunked, File "/snap/docker/1779/lib/python3.6/site-packages/urllib3/connectionpool.py", line 398, in _make_request conn.request(method, url, **httplib_request_kw) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1285, in request self._send_request(method, url, body, headers, encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1331, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 1046, in _send_output self.send(msg) File "/snap/docker/1779/usr/lib/python3.6/http/client.py", line 984, in send self.connect() File "/snap/docker/1779/lib/python3.6/site-packages/docker/transport/unixconn.py", line 30, in connect sock.connect(self.unix_socket) urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/snap/docker/1779/lib/python3.6/site-packages/docker/api/client.py", line 214, in _retrieve_server_version return self.version(api_version=False)["ApiVersion"] File "/snap/docker/1779/lib/python3.6/site-packages/docker/api/daemon.py", line 181, in version return self._result(self._get(url), json=True) File "/snap/docker/1779/lib/python3.6/site-packages/docker/utils/decorators.py", line 46, in inner return f(self, *args, kwargs) File "/snap/docker/1779/lib/python3.6/site-packages/docker/api/client.py", line 237, in _get return self.get(url, self._set_request_timeout(kwargs)) File "/snap/docker/1779/lib/python3.6/site-packages/requests/sessions.py", line 542, in get return self.request('GET', url, kwargs) File "/snap/docker/1779/lib/python3.6/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, send_kwargs) File "/snap/docker/1779/lib/python3.6/site-packages/requests/sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "/snap/docker/1779/lib/python3.6/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/snap/docker/1779/bin/docker-compose", line 33, in sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')()) File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/main.py", line 81, in main command_func() File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/main.py", line 200, in perform_command project = project_from_options('.', options) File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/command.py", line 70, in project_from_options enabled_profiles=get_profiles_from_options(options, environment) File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/command.py", line 153, in get_project verbose=verbose, version=api_version, context=context, environment=environment File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/docker_client.py", line 43, in get_client environment=environment, tls_version=get_tls_version(environment) File "/snap/docker/1779/lib/python3.6/site-packages/compose/cli/docker_client.py", line 170, in docker_client client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs) File "/snap/docker/1779/lib/python3.6/site-packages/docker/api/client.py", line 197, in init self._version = self._retrieve_server_version() File "/snap/docker/1779/lib/python3.6/site-packages/docker/api/client.py", line 222, in _retrieve_server_version f'Error while fetching server API version: {e}' docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))

Chester-CH commented 1 year ago

$ dpkg -l | grep -i docker ii docker-ce 5:20.10.18~3-0~ubuntu-jammy amd64 Docker: the open-source application container engine ii docker-ce-cli 5:20.10.18~3-0~ubuntu-jammy amd64 Docker CLI: the open-source application container engine ii docker-ce-rootless-extras 5:20.10.18~3-0~ubuntu-jammy amd64 Rootless support for Docker. ii docker-compose-plugin 2.10.2~ubuntu-jammy amd64 Docker Compose (V2) plugin for the Docker CLI. ii docker-scan-plugin 0.17.0~ubuntu-jammy amd64 Docker scan cli plugin.

rxue commented 1 year ago

encountered error when running for the first time, i.e. by using the latest Wildfly image

 Listening for transport dt_socket at address: 8787
 19:37:01,177 INFO  [org.jboss.modules] (main) JBoss Modules version 1.12.0.Final
 19:37:01,608 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.13.Final
 19:37:01,615 INFO  [org.jboss.threads] (main) JBoss Threads version 2.4.0.Final
 19:37:01,715 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 25.0.0.Final (WildFly Core 17.0.1.Final) starting
 19:37:02,411 INFO  [org.jboss.as.controller] (Controller Boot Thread) OPVDX002: Failed to pretty print validation error: null
 19:37:02,413 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
    at org.jboss.as.controller@17.0.1.Final//org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:137)
    at org.jboss.as.server@17.0.1.Final//org.jboss.as.server.ServerService.boot(ServerService.java:400)
    at org.jboss.as.controller@17.0.1.Final//org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:417)
    at java.base/java.lang.Thread.run(Thread.java:834)
 Caused by: javax.xml.stream.XMLStreamException: WFLYDM0145: Security realms are no longer supported, please remove them from the configuration.
    at org.jboss.as.domain-management@17.0.1.Final//org.jboss.as.domain.management.parsing.ManagementXml_5.parseManagement(ManagementXml_5.java:94)
    at org.jboss.as.server@17.0.1.Final//org.jboss.as.server.parsing.StandaloneXml_17.readServerElement(StandaloneXml_17.java:220)
    at org.jboss.as.server@17.0.1.Final//org.jboss.as.server.parsing.StandaloneXml_17.readElement(StandaloneXml_17.java:124)
    at org.jboss.as.server@17.0.1.Final//org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:147)
    at org.jboss.as.server@17.0.1.Final//org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:52)
    at org.jboss.staxmapper@1.3.0.Final//org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:122)
    at org.jboss.staxmapper@1.3.0.Final//org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:76)
    at org.jboss.as.controller@17.0.1.Final//org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:126)
    ... 3 more

 19:37:02,415 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
 19:37:02,426 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0050: WildFly Full 25.0.0.Final (WildFly Core 17.0.1.Final) stopped in 6ms
dictionary-web exited with code 1
Chester-CH commented 1 year ago

docker stop $(docker ps -a -q); docker rm $(docker ps -a -q); docker volume rm $(docker volume ls -qf dangling=true)

docker network rm $(docker network ls -q)

sudo lsof -nP | grep LISTEN

sudo kill -9 1548

Chester-CH commented 1 year ago

source: https://github.com/nginx-proxy/nginx-proxy/issues/839