filecoffee / proxy

💻 Use your own domain with file.coffee
https://file.coffee
4 stars 0 forks source link

Proxy errors and crashes while checking uploads #9

Open xXTheBigBearXx opened 3 years ago

xXTheBigBearXx commented 3 years ago
2021/05/06 23:36:00 [PROXY] Checking all uploads
2021/05/06 23:37:00 [PROXY] Checking all uploads
2021/05/06 23:37:00 stat /root/proxy/cache: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6e14aa]

goroutine 8 [running]:
github.com/filecoffee/proxy/modules.checkFile(0xc000026180, 0x11)
        /root/proxy/src/modules/remover.go:36 +0xaa
github.com/filecoffee/proxy/modules.checkFiles()
        /root/proxy/src/modules/remover.go:25 +0xb0
github.com/filecoffee/proxy/modules.Setup.func1()
        /root/proxy/src/modules/remover.go:17 +0x25
github.com/robfig/cron/v3.FuncJob.Run(0x949e10)
        /root/go/pkg/mod/github.com/robfig/cron/v3@v3.0.0/cron.go:131 +0x25
github.com/robfig/cron/v3.(*Cron).startJob.func1(0xc000526460, 0x9bc7c0, 0x949e10)
        /root/go/pkg/mod/github.com/robfig/cron/v3@v3.0.0/cron.go:307 +0x65
created by github.com/robfig/cron/v3.(*Cron).startJob
        /root/go/pkg/mod/github.com/robfig/cron/v3@v3.0.0/cron.go:305 +0x73
exit status 2

Manually creating a cache folder doesn't help, and the folder is no longer present after the crash

abcdan commented 3 years ago

can you delete the container and try again?

xXTheBigBearXx commented 3 years ago

The container? If you mean docker i didn't use it, just ran the go command from the "manual" method

abcdan commented 3 years ago

If possible, can you try with docker?

xXTheBigBearXx commented 3 years ago
root@ns501052:~/proxy# docker-compose up
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
abcdan commented 3 years ago

That's really strange.

abcdan commented 3 years ago

Can you git pull and try again?

xXTheBigBearXx commented 3 years ago
Creating proxy ... done
Creating nginx ...

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

ERROR: for nginx  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.22/containers/6dec168d56792c0e06f880f88c1012fd210a18e154a80c9adc3ba958a14a68a2/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 nginx (9f602270fc13ddd41000931b076a9574092d7e249480bb95f5320f31cef24c8e): 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'

Got further this time, but still failed.

Edit: just re-read the error and it failed bc port 80 was in use, is in use by apache