uwsgi running in Docker can't find initializtion file

11,848

I made a stupid mistake. File name must be 'uwsgi.conf', but not 'uswgi.conf'. When I fixed it, all started work as expected.

Share:
11,848
Roman Storozhenko
Author by

Roman Storozhenko

Email: [email protected] Skype: romeus_2009 Summary During my professional career (10+ years) I have worked in many professional domains, even as specific as low-level programming. Before the Desktop Age was over I had an opportunity to participate in an enterprise system development and some small desktop projects. Then I moved to web development domain and since that time I have made numerous web projects and learned a number of technologies. In the last few years my area of interests was shifted to cloud technologies, virtualization, storage solutions and linux kernel development. Those are my first (and I hope that not last) three patches that were accepted to the mainline Linux Kernel. You could see them in the Linus Torvalds's git repository: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?qt=author&q=Roman+Storozhenko I am going to continue work with the kernel. I am a reliable and hard-working person. I like to solve new challenging and complex tasks. Technical Skills Languages: Python, C, C++, C# , Javascript, PHP, Pascal, Assembly language (for x86 and pic-controllers architecture) Linux-related experience: kernel: device drivers development, memory management, filesystem progamming, network-related programming userspace: command-line utilities, daemons, network, multiprocess/multithreaded-style programming, etc... in accordance with the latest version of the POSIX standard. Virtualization: Oracle VirtualBox, VmWare Workstation, Xen Hypervisor, Docker, Kvm, QEMU Cloud: OpenStack, AWS: EC2, S3, RDS, SQS, Lambda, CloudFormation, EBS, OpsWorks Deployment: Ansible Python-related experience: Celery, Eventlet, Django, Django REST Framework, Tastypie, etc... DB-related experience: MySQL, MsSQL, ORACLE HTTP-Servers: Nginx, Apache, IIS VCS: Git, Mercurial, SVN CI: Jenkins Issue tracking systems: Atlassian stack (Jira + Bitbucket + Hipchat), Redmine Favourite editor: vim Certifications August, 2014 Certificate for Introduction to Linux: https://verify.edx.org/cert/bd44a4531d814ce8a0a8c450327ea353 October, 2016 Verified Certificate for Introduction to OpenStack: https://courses.edx.org/certificates/50485cc284634b199a15fbad5d45c2d7 Volunteer Experience Member at Taganrog Linux User Group February 2011 - Present Participated as a speaker in the conference Taganrog Linux User Group 2011 http://lug.tagan.ru/lugconf Languages English, Intermediate Level: https://www.dropbox.com/s/bnixx1lwysnwujn/certificate.jpg Russian Education Taganrog State University of Radioengineering engineer, Programming, 1996 - 2004 Interests Programming, Swimming, Gym, Travel, Linux, Open Source Public Profiles Linkedin: https://ru.linkedin.com/in/romeus78 GitHub: https://github.com/Romeus

Updated on June 07, 2022

Comments

  • Roman Storozhenko
    Roman Storozhenko almost 2 years

    I use Ubuntu 14.04 and Docker 1.0.1. I have a container that contains of python 2.7.6 and uwsgi 2.0.10. I created the Dockerfile:

    FROM romeus/python 
    MAINTAINER Me <my email>
    ENV REFRESHED_AT 2015-03-17
    
    RUN pip install uwsgi
    RUN pip install Django 
    
    RUN mkdir -p /var/www
    RUN mkdir -p /var/conf 
    
    VOLUME ["/var/www"]
    ADD uwsgi.conf /var/conf/
    
    
    CMD ["uwsgi", "--ini", "/var/conf/uswgi.conf"]
    

    Below I place my uswgi.conf:

    [uwsgi]
    http-socket = 0.0.0.0:8080
    wsgi-file = /var/www/test.py 
    processes = 4
    threads = 2
    stats = 0.0.0.0:8081
    

    When I log in to container:

    docker run --rm -it -p 8080 -p 8081 -v /home/hedin/projects/business
    /project/test/www:/var/www/ romeus/django /bin/bash
    

    And then run uwsgi with ini-file:

    uwsgi --ini /var/conf/uwsgi.conf
    

    It's starts and works as expected.

    But when I run it:

    docker run --rm -it -p 8080 -p 8081 -v /home/hedin/projects/business/project/test/www:/var/www/ romeus/django
    

    It's issues an error: realpath() of /var/conf/uswgi.conf failed: No such file or directory [core/utils.c line 3607]

    Does anybody knows what's a problem ?

    P.S. I changed a tail of my Dockerfile:

    COPY uwsgi.conf /var/conf/
    
    VOLUME ["/var/www"]
    
    CMD ["strace", "-f", "uwsgi", "--ini", "/var/conf/uswgi.conf"]
    

    This is last few lines of strace's output:

    lstat("/var/conf/uswgi.conf", 0x7fff9dcc6a40) = -1 ENOENT (No such file   or directory)
    lstat("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    lstat("/var/conf", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    lstat("/var/conf/uswgi.conf", 0x7fff9dcc59e0) = -1 ENOENT (No such file or directory)
    write(2, "realpath() of /var/conf/uswgi.co"..., 94realpath() of /var/conf/uswgi.conf failed: No such file or directory [core/utils.c line 3607]
    ) = 94
    exit_group(1)                           = ?
    +++ exited with 1 +++
    

    So it seems like file doesn't exists at the command run time. Any thoughts ?

  • Andy Shinn
    Andy Shinn about 9 years
    Can you accept your answer so that this question isn't listed in the Unanswered filter?
  • Roman Storozhenko
    Roman Storozhenko about 9 years
    When I tried to accept the question, it's says that I can do it tomorrow