thumbor-community / aws

Thumbor AWS extensions
MIT License
155 stars 70 forks source link

Getting "No security key was found" #145

Closed tinder-calvinliu closed 4 years ago

tinder-calvinliu commented 4 years ago

Trying to spin up thumbor with a dockerfile and trying to use aws s3 with python-3-slim

Dockerfile:

RUN pip install --no-cache-dir thumbor==6.7.5 envtpl==0.6.0 pycurl==7.43.0.5
RUN pip install --compile pycurl
RUN pip install tc_aws

App can build and run with originally without install tc_aws

service/thumbor/thumbor $ docker build -t thumbor:latest .
docker run -it -p 127.0.0.1:8888:8888 thumbor:latest

But once I install tc_aws I get

Traceback (most recent call last):
  File "/usr/local/bin/thumbor", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/thumbor/server.py", line 148, in main
    validate_config(config, server_parameters)
  File "/usr/local/lib/python3.8/site-packages/thumbor/server.py", line 82, in validate_config
    raise RuntimeError(
RuntimeError: No security key was found for this instance of thumbor. Please provide one using the conf file or a security key file.

The conf file is in the container for sure and that value is filled because I printed it in the server.py file and I get a valid value. Confused on what changes once aws is installed. Is it now referencing another config file besides thumbor.conf.tpl?

EDIT: It looks like server_parameters.security_key has turned into bytes instead of a string after downloading tc_aws but I dont know why

Bladrak commented 4 years ago

Hi, Most likely, you have python version compatibility issues. The migration of thumbor to python 3 is in progress, as is the migration of this repo (see #142). The stable versions of thumbor and tc_aws are only compatible with python 2 for now.

tinder-calvinliu commented 4 years ago

Yea its that problem, tc_aws is installing 6.7.5 which is not compatible with python 3