Can't access pdb prompt when attaching to a docker container I need to debugAttaching Python debuggerExposing a port on a live Docker containerCannot access tomcat8 server running in docker container from host machineDebug Nodejs inside Docker containerOpening Port in Docker ContainerDjango docker container failed to connect to mysql container with error “Can't connect to MySQL server on 'db' (111)”)Running Rails App in Docker Container using Non-Default PortExposing localhost ports in several local servicesCan't connect to MongoDB container from other Docker containerDocker-compose cannot find Flask configuration file

Heat-shrink tubing available as a roll like adhesive tape?

Is 写真 an onomatopoeia?

RX vs TX operation in Software UART

What's the lifetime of WIcked Wolf's +1/+1 counters?

Why would shrinking TEMPDB log lead to slowness?

Twelve Labours - #02 Lernaean Hydration

Length-terminated sequences

You may need me after too many

Are countries other than the US concerned about preferred pronouns and how they relate to gender?

Can a company prevent a co-author of a paper to put his name on it?

What can I wear to avoid getting frisked and crotch searched by TSA at the airport?

What kind of mathematical disciplines would be most useful for physics?

At what point can you walk out of a restaurant if they make you wait to pay the bill?

Why is a 737 Original speed-restricted below 10,000 ft with inoperative windscreen heating?

Why can java not infer a supertype

Implement the 2D Hadamard Transform

"Push chord". What's that?

Copying files: Does Windows write to disk if files are identical

Translate "loyal animal" into classical Latin

should I include offer letter from a different institution in my application for a faculty position

Would fantasy dwarves be able to invent and/or manufacture the radio?

Articles at the beginning of sentences in scientific writing

Is there a name for the phenomenon of false positives counterintuitively outstripping true positives

Why didn't Petunia know that Harry wasn't supposed to use magic out of school?



Can't access pdb prompt when attaching to a docker container I need to debug


Attaching Python debuggerExposing a port on a live Docker containerCannot access tomcat8 server running in docker container from host machineDebug Nodejs inside Docker containerOpening Port in Docker ContainerDjango docker container failed to connect to mysql container with error “Can't connect to MySQL server on 'db' (111)”)Running Rails App in Docker Container using Non-Default PortExposing localhost ports in several local servicesCan't connect to MongoDB container from other Docker containerDocker-compose cannot find Flask configuration file






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0

















I debug the dockerized python-flask app I'm working on by adding stdin_open: true and tty: true to the end of the web service in the docker-compose.yml. Then, I run docker attach in a terminal and use the resulting pdb prompt.



This always worked in the past. Today when I type docker attach <web_container_id> in the terminal, the terminal stays blank and the pdb prompt doesn't open. Additionally, the website hangs and doesn't load. When I run docker logs <web_container_id>, the logs shows that the debugger was active. But I can't access the pdb prompt. Any idea what I'm doing wrong?



TLDR: Why can't I interact with the pdb prompt in the terminal when I attach to the docker container?



version: "3"

services:
db:
restart: always
image: postgres:latest
environment:
POSTGRES_USER: fake_user
POSTGRES_PASSWORD: fakepassword
POSTGRES_DB: fake-db
volumes:
- ./container_data/postgres:/var/lib/postgresql/data
ports:
- "8080:8080"

web:
restart: always
build:
context: .
dockerfile: ./dockerfiles/web/Dockerfile
environment:
AWS_ACCESS_KEY_ID: "$AWS_ACCESS_KEY_ID"
AWS_SECRET_ACCESS_KEY: "$AWS_SECRET_ACCESS_KEY"
AWS_DEFAULT_REGION: "$AWS_DEFAULT_REGION"
S3_BUCKET_NAME: "$S3_BUCKET_NAME"
FLASK_APP: app
FLASK_ENV: "$FLASK_ENV:-development"
volumes:
- ./FakeApp/:/usr/src/app/FakeApp/:z
links:
- postgres:postgres
expose:
- "3000"
command: flask run --host=0.0.0.0 --port=3000
ports:
- "3000:3000"
tty: true
stdin_open: true


Here are some resources I already read online:
- https://blog.lucasferreira.org/howto/2017/06/03/running-pdb-with-docker-and-gunicorn.html
- Attaching Python debugger










share|improve this question
































    0

















    I debug the dockerized python-flask app I'm working on by adding stdin_open: true and tty: true to the end of the web service in the docker-compose.yml. Then, I run docker attach in a terminal and use the resulting pdb prompt.



    This always worked in the past. Today when I type docker attach <web_container_id> in the terminal, the terminal stays blank and the pdb prompt doesn't open. Additionally, the website hangs and doesn't load. When I run docker logs <web_container_id>, the logs shows that the debugger was active. But I can't access the pdb prompt. Any idea what I'm doing wrong?



    TLDR: Why can't I interact with the pdb prompt in the terminal when I attach to the docker container?



    version: "3"

    services:
    db:
    restart: always
    image: postgres:latest
    environment:
    POSTGRES_USER: fake_user
    POSTGRES_PASSWORD: fakepassword
    POSTGRES_DB: fake-db
    volumes:
    - ./container_data/postgres:/var/lib/postgresql/data
    ports:
    - "8080:8080"

    web:
    restart: always
    build:
    context: .
    dockerfile: ./dockerfiles/web/Dockerfile
    environment:
    AWS_ACCESS_KEY_ID: "$AWS_ACCESS_KEY_ID"
    AWS_SECRET_ACCESS_KEY: "$AWS_SECRET_ACCESS_KEY"
    AWS_DEFAULT_REGION: "$AWS_DEFAULT_REGION"
    S3_BUCKET_NAME: "$S3_BUCKET_NAME"
    FLASK_APP: app
    FLASK_ENV: "$FLASK_ENV:-development"
    volumes:
    - ./FakeApp/:/usr/src/app/FakeApp/:z
    links:
    - postgres:postgres
    expose:
    - "3000"
    command: flask run --host=0.0.0.0 --port=3000
    ports:
    - "3000:3000"
    tty: true
    stdin_open: true


    Here are some resources I already read online:
    - https://blog.lucasferreira.org/howto/2017/06/03/running-pdb-with-docker-and-gunicorn.html
    - Attaching Python debugger










    share|improve this question




























      0












      0








      0








      I debug the dockerized python-flask app I'm working on by adding stdin_open: true and tty: true to the end of the web service in the docker-compose.yml. Then, I run docker attach in a terminal and use the resulting pdb prompt.



      This always worked in the past. Today when I type docker attach <web_container_id> in the terminal, the terminal stays blank and the pdb prompt doesn't open. Additionally, the website hangs and doesn't load. When I run docker logs <web_container_id>, the logs shows that the debugger was active. But I can't access the pdb prompt. Any idea what I'm doing wrong?



      TLDR: Why can't I interact with the pdb prompt in the terminal when I attach to the docker container?



      version: "3"

      services:
      db:
      restart: always
      image: postgres:latest
      environment:
      POSTGRES_USER: fake_user
      POSTGRES_PASSWORD: fakepassword
      POSTGRES_DB: fake-db
      volumes:
      - ./container_data/postgres:/var/lib/postgresql/data
      ports:
      - "8080:8080"

      web:
      restart: always
      build:
      context: .
      dockerfile: ./dockerfiles/web/Dockerfile
      environment:
      AWS_ACCESS_KEY_ID: "$AWS_ACCESS_KEY_ID"
      AWS_SECRET_ACCESS_KEY: "$AWS_SECRET_ACCESS_KEY"
      AWS_DEFAULT_REGION: "$AWS_DEFAULT_REGION"
      S3_BUCKET_NAME: "$S3_BUCKET_NAME"
      FLASK_APP: app
      FLASK_ENV: "$FLASK_ENV:-development"
      volumes:
      - ./FakeApp/:/usr/src/app/FakeApp/:z
      links:
      - postgres:postgres
      expose:
      - "3000"
      command: flask run --host=0.0.0.0 --port=3000
      ports:
      - "3000:3000"
      tty: true
      stdin_open: true


      Here are some resources I already read online:
      - https://blog.lucasferreira.org/howto/2017/06/03/running-pdb-with-docker-and-gunicorn.html
      - Attaching Python debugger










      share|improve this question















      I debug the dockerized python-flask app I'm working on by adding stdin_open: true and tty: true to the end of the web service in the docker-compose.yml. Then, I run docker attach in a terminal and use the resulting pdb prompt.



      This always worked in the past. Today when I type docker attach <web_container_id> in the terminal, the terminal stays blank and the pdb prompt doesn't open. Additionally, the website hangs and doesn't load. When I run docker logs <web_container_id>, the logs shows that the debugger was active. But I can't access the pdb prompt. Any idea what I'm doing wrong?



      TLDR: Why can't I interact with the pdb prompt in the terminal when I attach to the docker container?



      version: "3"

      services:
      db:
      restart: always
      image: postgres:latest
      environment:
      POSTGRES_USER: fake_user
      POSTGRES_PASSWORD: fakepassword
      POSTGRES_DB: fake-db
      volumes:
      - ./container_data/postgres:/var/lib/postgresql/data
      ports:
      - "8080:8080"

      web:
      restart: always
      build:
      context: .
      dockerfile: ./dockerfiles/web/Dockerfile
      environment:
      AWS_ACCESS_KEY_ID: "$AWS_ACCESS_KEY_ID"
      AWS_SECRET_ACCESS_KEY: "$AWS_SECRET_ACCESS_KEY"
      AWS_DEFAULT_REGION: "$AWS_DEFAULT_REGION"
      S3_BUCKET_NAME: "$S3_BUCKET_NAME"
      FLASK_APP: app
      FLASK_ENV: "$FLASK_ENV:-development"
      volumes:
      - ./FakeApp/:/usr/src/app/FakeApp/:z
      links:
      - postgres:postgres
      expose:
      - "3000"
      command: flask run --host=0.0.0.0 --port=3000
      ports:
      - "3000:3000"
      tty: true
      stdin_open: true


      Here are some resources I already read online:
      - https://blog.lucasferreira.org/howto/2017/06/03/running-pdb-with-docker-and-gunicorn.html
      - Attaching Python debugger







      python docker debugging flask pdb






      share|improve this question














      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 21:40









      ByteByByteByteByByte

      236 bronze badges




      236 bronze badges

























          0






          active

          oldest

          votes













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407255%2fcant-access-pdb-prompt-when-attaching-to-a-docker-container-i-need-to-debug%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown


























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407255%2fcant-access-pdb-prompt-when-attaching-to-a-docker-container-i-need-to-debug%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown









          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript