NGINX-Demos icon indicating copy to clipboard operation
NGINX-Demos copied to clipboard

nginx-regex-tester does not compile with docker-compose

Open salos1982 opened this issue 4 years ago • 3 comments

I'm trying to build nginx-regex-tester but it does not build

WARNING: Image for service regextester was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating regextester ... 

ERROR: for regextester  a bytes-like object is required, not 'str'

ERROR: for regextester  a bytes-like object is required, not 'str'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 261, in _raise_for_status
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.21/containers/07e0ff960cf5ec624fd607fa560ca69d2882911aa6b46c60149528d3328fd5a7/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/compose/service.py", line 625, in start_container
    container.start()
  File "/usr/lib/python3/dist-packages/compose/container.py", line 241, in start
    return self.client.start(self.id, **options)
  File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/api/container.py", line 1095, in start
    self._raise_for_status(res)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 263, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/lib/python3/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("b'driver failed programming external connectivity on endpoint regextester (d441b27e8a6e4807896c03be1998af92359013b35568ebe99d6aee0d5f284e92): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 11, in <module>
    load_entry_point('docker-compose==1.25.0', 'console_scripts', 'docker-compose')()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 72, in main
    command()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 128, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1107, in up
    to_attach = up(False)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1088, in up
    return self.project.up(
  File "/usr/lib/python3/dist-packages/compose/project.py", line 565, in up
    results, errors = parallel.parallel_execute(
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/project.py", line 548, in do
    return service.execute_convergence_plan(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 545, in execute_convergence_plan
    return self._execute_convergence_create(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 460, in _execute_convergence_create
    containers, errors = parallel_execute(
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/service.py", line 465, in <lambda>
    lambda service_name: create_and_start(self, service_name.number),
  File "/usr/lib/python3/dist-packages/compose/service.py", line 457, in create_and_start
    self.start_container(container)
  File "/usr/lib/python3/dist-packages/compose/service.py", line 627, in start_container
    if "driver failed programming external connectivity" in ex.explanation:
TypeError: a bytes-like object is required, not 'str'

salos1982 avatar Jun 28 '21 12:06 salos1982

I'm trying to build nginx-regex-tester with docker-compose too, but i get another error:

Step 5/15 : RUN wget -q -O - http://nginx.org/keys/nginx_signing.key | apt-key add -
 ---> Running in f59575d66344
ERROR: Service 'regextester' failed to build: panic: runtime error: index out of range [9173] with length 9173

goroutine 1 [running]:
encoding/json.(*decodeState).skip(0xc0000b09c8)
	/usr/lib/go-1.13/src/encoding/json/decode.go:324 +0xc0
encoding/json.(*decodeState).value(0xc0000b09c8, 0x0, 0x0, 0x0, 0x7, 0x3de5)
	/usr/lib/go-1.13/src/encoding/json/decode.go:433 +0xc2
encoding/json.(*decodeState).object(0xc0000b09c8, 0x8b6600, 0xc00000e088, 0x16, 0xc0000b09f0, 0x7b)
	/usr/lib/go-1.13/src/encoding/json/decode.go:823 +0x1392
encoding/json.(*decodeState).value(0xc0000b09c8, 0x8b6600, 0xc00000e088, 0x16, 0xc000051638, 0x510dfe)
	/usr/lib/go-1.13/src/encoding/json/decode.go:429 +0x6d
encoding/json.(*decodeState).unmarshal(0xc0000b09c8, 0x8b6600, 0xc00000e088, 0x0, 0x1)
	/usr/lib/go-1.13/src/encoding/json/decode.go:179 +0x1fb
encoding/json.(*Decoder).Decode(0xc0000b09a0, 0x8b6600, 0xc00000e088, 0x7fff00000000, 0xc00000e080)
	/usr/lib/go-1.13/src/encoding/json/stream.go:73 +0x166
github.com/containerd/containerd/runtime/v2/runc/v2.readSpec(0x0, 0x0, 0x0)
	/build/containerd-HQaNe5/containerd-1.4.4/.gopath/src/github.com/containerd/containerd/runtime/v2/runc/v2/service.go:168 +0x137
github.com/containerd/containerd/runtime/v2/runc/v2.(*service).StartShim(0xc0000e4200, 0xa24c40, 0xc00007e500, 0x7fff3c614d7c, 0x40, 0x7fff3c614d64, 0x13, 0x7fff3c614d34, 0x1f, 0xc00002a00e, ...)
	/build/containerd-HQaNe5/containerd-1.4.4/.gopath/src/github.com/containerd/containerd/runtime/v2/runc/v2/service.go:180 +0xf0
github.com/containerd/containerd/runtime/v2/shim.run(0x9903a4, 0x15, 0x9a6818, 0x0, 0x0, 0x0)
	/build/containerd-HQaNe5/containerd-1.4.4/.gopath/src/github.com/containerd/containerd/runtime/v2/shim/shim.go:222 +0xebc
github.com/containerd/containerd/runtime/v2/shim.Run(0x9903a4, 0x15, 0x9a6818, 0x0, 0x0, 0x0)
	/build/containerd-HQaNe5/containerd-1.4.4/.gopath/src/github.com/containerd/containerd/runtime/v2/shim/shim.go:153 +0xc4
main.main()
	/build/containerd-HQaNe5/containerd-1.4.4/.gopath/src/github.com/containerd/containerd/cmd/containerd-shim-runc-v2/main.go:27 +0x53
: exit status 2: unknown

iluhavlg avatar Aug 21 '21 09:08 iluhavlg

salos1982, it looks like there is something already listening on port 80 and this is the port the regex tester is configured to run on.

tienidurodad avatar Aug 30 '21 20:08 tienidurodad

luhavlg, I don't know what is causing your errors. I've had colleagues these this without issue so It doesn't appear to be the application. I expect there is some problem with your environment.

tienidurodad avatar Aug 30 '21 20:08 tienidurodad