Git Product home page Git Product logo

Comments (6)

mikeizbicki avatar mikeizbicki commented on August 30, 2024

Yes, that container should be visible with docker ps if everything ran correctly. You can use docker-compose logs pg_normalized_batch to view the logs for that container to find our why it shut down.

from cmc-csci143.

sjanefullerton avatar sjanefullerton commented on August 30, 2024

That is good to know, thank you! These are the outputs when I run that command. Would it be safe for me to remove the /var/lib/postgresql/data directory or is there a better approach to solve this?

lambda-server:~/twitter_postgres_indexes (master>) $ docker-compose logs pg_normalized_batch
/home/sfullerton24/.local/lib/python3.6/site-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
  from cryptography.hazmat.backends import default_backend
Attaching to twitter_postgres_indexes_pg_normalized_batch_1
pg_normalized_batch_1  | The files belonging to this database system will be owned by user "postgres".
pg_normalized_batch_1  | This user must also own the server process.
pg_normalized_batch_1  | 
pg_normalized_batch_1  | The database cluster will be initialized with locale "en_US.utf8".
pg_normalized_batch_1  | The default database encoding has accordingly been set to "UTF8".
pg_normalized_batch_1  | The default text search configuration will be set to "english".
pg_normalized_batch_1  | 
pg_normalized_batch_1  | Data page checksums are disabled.
pg_normalized_batch_1  | initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
pg_normalized_batch_1  | initdb: hint: If you want to create a new database system, either remove or empty the directory "/var/lib/postgresql/data" or run initdb with an argument other than "/var/lib/postgresql/data".
pg_normalized_batch_1  | 

from cmc-csci143.

mikeizbicki avatar mikeizbicki commented on August 30, 2024

Yes, it is safe to remove that directory, and that is what you should do if they database gets corrupted like this. The following command (from the part 0 instructions) should achieve that:

$ docker-compose exec pg_normalized_batch bash -c 'rm -rf $PGDATA'

from cmc-csci143.

sjanefullerton avatar sjanefullerton commented on August 30, 2024

Thank you for your help. I am sorry, I am confused what to do to fix this. Is there a step I have missed? These are the steps I took:

  1. I brought down/stopped all the containers and pruned the volumes.

  2. I then ran the following to make sure that the directory was removed:

lambda-server:~/twitter_postgres_indexes (master>) $ docker-compose exec pg_normalized_batch bash -c 'rm -rf $PGDATA'

lambda-server:~/twitter_postgres_indexes (master>) $ docker-compose exec pg_denormalized bash -c 'rm -rf $PGDATA'

lambda-server:~/twitter_postgres_indexes (master>) $ rm -rf /var/lib/postgresql/data
  1. I checked to see if the directory was removed:
lambda-server:~/twitter_postgres_indexes (master>) $ ls -l /var/lib/postgresql
total 16
drwxr-xr-x  3 postgres postgres 4096 Nov 22  2019 10
drwx------  2 postgres postgres 4096 Jul  2  2020 pythainlp-data
drwxrwxr-x 10 postgres postgres 4096 Jul  2  2020 spacy
drwxrwxr-x  6 postgres postgres 4096 Jul  2  2020 venv

I do not see it here so I assume it was removed.

However, when I build and brought back up the containers, I am still getting the same error

pg_normalized_batch_1  | initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
pg_normalized_batch_1  | initdb: hint: If you want to create a new database system, either remove or empty the directory "/var/lib/postgresql/data" or run initdb with an argument other than "/var/lib/postgresql/data".

from cmc-csci143.

mikeizbicki avatar mikeizbicki commented on August 30, 2024

Whenever you run commands without docker-compose, they are being run on the lambda server and not inside the container. In particular,

$ ls -l /var/lib/postgresql

is being run on the lambda server. So it can't tell you whether the data directories were successfully removed or not.

In any event, I have deleted these folders for you manually (as root on the lambda server) to get you unstuck on this step.

from cmc-csci143.

sjanefullerton avatar sjanefullerton commented on August 30, 2024

Thank you!!

from cmc-csci143.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.