This is an error I have found while using Django, ...
# general
b
This is an error I have found while using Django, pants and Docker. When I run `sudo docker compose up`to run the containers it gives this error yet all my directories have build files and also had to restructure the directory structure so even the accounts module is found at the root as the other directories that can be read....Really need some help on this can provide more code concerning the issue
e
Debugging from the highest level, docker compose - will be near impossible. We'll have to start lower. Can you open source the repo or relevant portions of it for us to help see what you're seeing?
b
This is a link to the repo you can take a look and see what I am seeing
e
That link does not work:
Maybe the repo is private?:
b
Sorry about that
Did this work??
e
I responded past midnight my time and shortly went to bed. Looking now.
b
It is okay, will be waiting for your response
e
So this works:
Copy code
$ pants package ::
10:47:38.89 [INFO] Wrote dist/fleetdatabaseFinal/django-admin.pex
10:47:38.89 [INFO] Wrote dist/fleetdatabaseFinal/manage.pex
10:47:38.89 [INFO] Wrote dist/fleetdatabaseFinal/production.pex
$ dist/fleetdatabaseFinal/production.pex fleetdatabaseFinal.wsgi -- bind 0.0.0.0:5000
[2023-04-24 10:47:44 -0700] [67984] [INFO] Starting gunicorn 20.1.0
[2023-04-24 10:47:44 -0700] [67984] [INFO] Listening at: <http://127.0.0.1:8000> (67984)
[2023-04-24 10:47:44 -0700] [67984] [INFO] Using worker: sync
[2023-04-24 10:47:44 -0700] [67999] [INFO] Booting worker with pid: 67999
^C[2023-04-24 10:47:47 -0700] [67984] [INFO] Handling signal: int
[2023-04-24 17:47:47 +0000] [67999] [INFO] Worker exiting (pid: 67999)
[2023-04-24 10:47:47 -0700] [67984] [INFO] Shutting down: Master
This errors early for me:
Copy code
$ docker compose up
[+] Building 0.0s (2/2) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                         0.0s
 => => transferring dockerfile: 2B                                                                                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                                                                                            0.0s
 => => transferring context: 2B                                                                                                                                                                              0.0s
failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount803776955/Dockerfile: no such file or directory
Did you miss publicizing a Dockerfile?
b
Oh I see you can manually add it under the /dist/fleetdatabaseFinal directory
Here is my Dockerfile
e
Thanks. That works fine for me:
Copy code
$ docker compose up
[+] Running 2/0
 ✔ Container open-fleetbackend-db-1                   Recreated                                                                                                                                              0.0s
 ✔ Container open-fleetbackend-application-service-1  Created                                                                                                                                                0.0s
Attaching to open-fleetbackend-application-service-1, open-fleetbackend-db-1
open-fleetbackend-db-1                   | The files belonging to this database system will be owned by user "postgres".
open-fleetbackend-db-1                   | This user must also own the server process.
open-fleetbackend-db-1                   |
open-fleetbackend-db-1                   | The database cluster will be initialized with locale "en_US.utf8".
open-fleetbackend-db-1                   | The default database encoding has accordingly been set to "UTF8".
open-fleetbackend-db-1                   | The default text search configuration will be set to "english".
open-fleetbackend-db-1                   |
open-fleetbackend-db-1                   | Data page checksums are disabled.
open-fleetbackend-db-1                   |
open-fleetbackend-db-1                   | fixing permissions on existing directory /var/lib/postgresql/data ... ok
open-fleetbackend-db-1                   | creating subdirectories ... ok
open-fleetbackend-db-1                   | selecting dynamic shared memory implementation ... posix
open-fleetbackend-db-1                   | selecting default max_connections ... 100
open-fleetbackend-db-1                   | selecting default shared_buffers ... 128MB
open-fleetbackend-db-1                   | selecting default time zone ... UTC
open-fleetbackend-db-1                   | creating configuration files ... ok
open-fleetbackend-db-1                   | running bootstrap script ... ok
open-fleetbackend-db-1                   | sh: locale: not found
open-fleetbackend-db-1                   | 2023-04-24 18:03:50.849 UTC [30] WARNING:  no usable system locales were found
open-fleetbackend-application-service-1  | [2023-04-24 18:03:50 +0000] [1] [INFO] Starting gunicorn 20.1.0
open-fleetbackend-application-service-1  | [2023-04-24 18:03:50 +0000] [1] [INFO] Listening at: <http://127.0.0.1:8000> (1)
open-fleetbackend-application-service-1  | [2023-04-24 18:03:50 +0000] [1] [INFO] Using worker: sync
open-fleetbackend-application-service-1  | [2023-04-24 18:03:50 +0000] [7] [INFO] Booting worker with pid: 7
open-fleetbackend-db-1                   | performing post-bootstrap initialization ... ok
open-fleetbackend-db-1                   | syncing data to disk ... ok
open-fleetbackend-db-1                   |
open-fleetbackend-db-1                   |
open-fleetbackend-db-1                   | Success. You can now start the database server using:
open-fleetbackend-db-1                   |
open-fleetbackend-db-1                   |     pg_ctl -D /var/lib/postgresql/data -l logfile start
open-fleetbackend-db-1                   |
open-fleetbackend-db-1                   | initdb: warning: enabling "trust" authentication for local connections
open-fleetbackend-db-1                   | You can change this by editing pg_hba.conf or using the option -A, or
open-fleetbackend-db-1                   | --auth-local and --auth-host, the next time you run initdb.
open-fleetbackend-db-1                   | waiting for server to start....2023-04-24 18:03:51.309 UTC [36] LOG:  starting PostgreSQL 14.1 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.311 UTC [36] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.316 UTC [37] LOG:  database system was shut down at 2023-04-24 18:03:51 UTC
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.318 UTC [36] LOG:  database system is ready to accept connections
open-fleetbackend-db-1                   |  done
open-fleetbackend-db-1                   | server started
open-fleetbackend-db-1                   |
open-fleetbackend-db-1                   | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
open-fleetbackend-db-1                   |
open-fleetbackend-db-1                   | waiting for server to shut down....2023-04-24 18:03:51.414 UTC [36] LOG:  received fast shutdown request
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.417 UTC [36] LOG:  aborting any active transactions
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.418 UTC [36] LOG:  background worker "logical replication launcher" (PID 43) exited with exit code 1
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.418 UTC [38] LOG:  shutting down
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.430 UTC [36] LOG:  database system is shut down
open-fleetbackend-db-1                   |  done
open-fleetbackend-db-1                   | server stopped
open-fleetbackend-db-1                   |
open-fleetbackend-db-1                   | PostgreSQL init process complete; ready for start up.
open-fleetbackend-db-1                   |
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.532 UTC [1] LOG:  starting PostgreSQL 14.1 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.533 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.533 UTC [1] LOG:  listening on IPv6 address "::", port 5432
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.537 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.540 UTC [48] LOG:  database system was shut down at 2023-04-24 18:03:51 UTC
open-fleetbackend-db-1                   | 2023-04-24 18:03:51.543 UTC [1] LOG:  database system is ready to accept connections
@brash-area-42337 your use of
sudo
on
docker compose up
is certainly one red flag.
b
It really keeps saying that Module name accounts not found
In fact it is only happening on my machine, a colleague of mine says it is running on their machine
e
Ok. Well that will be truly hard to debug remotely.
b
Copy code
kennan@medad:~/NPA_Projects/fleet-backend$ docker compose up
[+] Running 2/0
 ✔ Container fleet-backend-db-1                   Running                                                                    0.0s 
 ✔ Container fleet-backend-application-service-1  Created                                                                    0.0s 
Attaching to fleet-backend-application-service-1, fleet-backend-db-1
fleet-backend-application-service-1  | [2023-04-24 18:38:07 +0000] [1] [INFO] Starting gunicorn 20.1.0
fleet-backend-application-service-1  | [2023-04-24 18:38:07 +0000] [1] [INFO] Listening at: <http://127.0.0.1:8000> (1)
fleet-backend-application-service-1  | [2023-04-24 18:38:07 +0000] [1] [INFO] Using worker: sync
fleet-backend-application-service-1  | [2023-04-24 18:38:07 +0000] [6] [INFO] Booting worker with pid: 6
fleet-backend-application-service-1  | [2023-04-24 18:38:08 +0000] [6] [ERROR] Exception in worker process
fleet-backend-application-service-1  | Traceback (most recent call last):
fleet-backend-application-service-1  |   File "/root/.pex/installed_wheels/48a8aa8894e1b47c4d7b44dba4b1adff054ea189e0708d789c3ba5cf2a485b0d/gunicorn-20.1.0-py3-none-any.whl/gunicorn/arbiter.py", line 589, in spawn_worker
fleet-backend-application-service-1  |     worker.init_process()
fleet-backend-application-service-1  |   File "/root/.pex/installed_wheels/48a8aa8894e1b47c4d7b44dba4b1adff054ea189e0708d789c3ba5cf2a485b0d/gunicorn-20.1.0-py3-none-any.whl/gunicorn/workers/base.py", line 134, in init_process
fleet-backend-application-service-1  |     self.load_wsgi()
fleet-backend-application-service-1  |   File "/root/.pex/installed_wheels/48a8aa8894e1b47c4d7b44dba4b1adff054ea189e0708d789c3ba5cf2a485b0d/gunicorn-20.1.0-py3-none-any.whl/gunicorn/workers/base.py", line 146, in load_wsgi
fleet-backend-application-service-1  |     self.wsgi = self.app.wsgi()
fleet-backend-application-service-1  |   File "/root/.pex/installed_wheels/48a8aa8894e1b47c4d7b44dba4b1adff054ea189e0708d789c3ba5cf2a485b0d/gunicorn-20.1.0-py3-none-any.whl/gunicorn/app/base.py", line 67, in wsgi
fleet-backend-application-service-1  |     self.callable = self.load()
fleet-backend-application-service-1  |   File "/root/.pex/installed_wheels/48a8aa8894e1b47c4d7b44dba4b1adff054ea189e0708d789c3ba5cf2a485b0d/gunicorn-20.1.0-py3-none-any.whl/gunicorn/app/wsgiapp.py", line 58, in load
fleet-backend-application-service-1  |     return self.load_wsgiapp()
fleet-backend-application-service-1  |   File "/root/.pex/installed_wheels/48a8aa8894e1b47c4d7b44dba4b1adff054ea189e0708d789c3ba5cf2a485b0d/gunicorn-20.1.0-py3-none-any.whl/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
fleet-backend-application-service-1  |     return util.import_app(self.app_uri)
fleet-backend-application-service-1  |   File "/root/.pex/installed_wheels/48a8aa8894e1b47c4d7b44dba4b1adff054ea189e0708d789c3ba5cf2a485b0d/gunicorn-20.1.0-py3-none-any.whl/gunicorn/util.py", line 359, in import_app
fleet-backend-application-service-1  |     mod = importlib.import_module(module)
fleet-backend-application-service-1  |   File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
fleet-backend-application-service-1  |     return _bootstrap._gcd_import(name[level:], package, level)
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap_external>", line 850, in exec_module
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
fleet-backend-application-service-1  |   File "/root/.pex/unzipped_pexes/a34be76e42ddd7714a845d93a7f634417effa491/fleetdatabaseFinal/wsgi.py", line 16, in <module>
fleet-backend-application-service-1  |     application = get_wsgi_application()
fleet-backend-application-service-1  |   File "/root/.pex/installed_wheels/ba7b3b60845048a44d2e41a4e4a52139aed31176b2358657f84b4e506efcde25/Django-4.1.7-py3-none-any.whl/django/core/wsgi.py", line 12, in get_wsgi_application
fleet-backend-application-service-1  |     django.setup(set_prefix=False)
fleet-backend-application-service-1  |   File "/root/.pex/installed_wheels/ba7b3b60845048a44d2e41a4e4a52139aed31176b2358657f84b4e506efcde25/Django-4.1.7-py3-none-any.whl/django/__init__.py", line 24, in setup
fleet-backend-application-service-1  |     apps.populate(settings.INSTALLED_APPS)
fleet-backend-application-service-1  |   File "/root/.pex/installed_wheels/ba7b3b60845048a44d2e41a4e4a52139aed31176b2358657f84b4e506efcde25/Django-4.1.7-py3-none-any.whl/django/apps/registry.py", line 91, in populate
fleet-backend-application-service-1  |     app_config = AppConfig.create(entry)
fleet-backend-application-service-1  |   File "/root/.pex/installed_wheels/ba7b3b60845048a44d2e41a4e4a52139aed31176b2358657f84b4e506efcde25/Django-4.1.7-py3-none-any.whl/django/apps/config.py", line 178, in create
fleet-backend-application-service-1  |     mod = import_module(mod_path)
fleet-backend-application-service-1  |   File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
fleet-backend-application-service-1  |     return _bootstrap._gcd_import(name[level:], package, level)
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
fleet-backend-application-service-1  |   File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
fleet-backend-application-service-1  | ModuleNotFoundError: No module named 'accounts'
fleet-backend-application-service-1  | [2023-04-24 18:38:08 +0000] [6] [INFO] Worker exiting (pid: 6)
fleet-backend-application-service-1  | [2023-04-24 18:38:09 +0000] [1] [INFO] Shutting down: Master
fleet-backend-application-service-1  | [2023-04-24 18:38:09 +0000] [1] [INFO] Reason: Worker failed to boot.
fleet-backend-application-service-1 exited with code 3
Could the problem be on my machine??
e
It clearly is! So, can you provide a listing of your PEX file?
zipinfo your.pex
?
b
How can I do that?
e
zipinfo your.pex
b
So I run this in my terminal??
e
Yes. For example:
Copy code
$ zipinfo dist/fleetdatabaseFinal/production.pex
Archive:  dist/fleetdatabaseFinal/production.pex
Zip file size: 26465839 bytes, number of entries: 8698
drwxr-xr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 .bootstrap/
drwxr-xr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 .bootstrap/pex/
-rw-r--r--  2.0 unx      401 b- defN 80-Jan-01 00:00 .bootstrap/pex/__init__.py
-rw-r--r--  2.0 unx      235 b- defN 80-Jan-01 00:00 .bootstrap/pex/__main__.py
-rw-r--r--  2.0 unx      601 b- defN 80-Jan-01 00:00 .bootstrap/pex/argparse.py
-rw-r--r--  2.0 unx      483 b- defN 80-Jan-01 00:00 .bootstrap/pex/attrs.py
-rw-r--r--  2.0 unx     5898 b- defN 80-Jan-01 00:00 .bootstrap/pex/auth.py
-rw-r--r--  2.0 unx     3084 b- defN 80-Jan-01 00:00 .bootstrap/pex/bootstrap.py

... SNIPPED ...

drwxr-xr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 .deps/typing_extensions-4.5.0-py3-none-any.whl/
-rw-r--r--  2.0 unx       86 b- defN 80-Jan-01 00:00 .deps/typing_extensions-4.5.0-py3-none-any.whl/.layout.json
-rw-r--r--  2.0 unx    84065 b- defN 80-Jan-01 00:00 .deps/typing_extensions-4.5.0-py3-none-any.whl/typing_extensions.py
drwxr-xr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 .deps/typing_extensions-4.5.0-py3-none-any.whl/typing_extensions-4.5.0.dist-info/
-rw-r--r--  2.0 unx        4 b- defN 80-Jan-01 00:00 .deps/typing_extensions-4.5.0-py3-none-any.whl/typing_extensions-4.5.0.dist-info/INSTALLER
-rw-r--r--  2.0 unx    12787 b- defN 80-Jan-01 00:00 .deps/typing_extensions-4.5.0-py3-none-any.whl/typing_extensions-4.5.0.dist-info/LICENSE
-rw-r--r--  2.0 unx     8529 b- defN 80-Jan-01 00:00 .deps/typing_extensions-4.5.0-py3-none-any.whl/typing_extensions-4.5.0.dist-info/METADATA
-rw-r--r--  2.0 unx        0 b- defN 80-Jan-01 00:00 .deps/typing_extensions-4.5.0-py3-none-any.whl/typing_extensions-4.5.0.dist-info/REQUESTED
-rw-r--r--  2.0 unx       81 b- defN 80-Jan-01 00:00 .deps/typing_extensions-4.5.0-py3-none-any.whl/typing_extensions-4.5.0.dist-info/WHEEL
-rw-r--r--  2.0 unx     2379 b- defN 80-Jan-01 00:00 PEX-INFO
-rwxr-xr-x  2.0 unx     3503 b- defN 80-Jan-01 00:00 __main__.py
drwxr-xr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 __pex__/
-rw-r--r--  2.0 unx     3477 b- defN 80-Jan-01 00:00 __pex__/__init__.py
drwxr-xr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 accounts/
-rw-r--r--  2.0 unx        0 b- defN 80-Jan-01 00:00 accounts/__init__.py
-rw-r--r--  2.0 unx     4304 b- defN 80-Jan-01 00:00 accounts/admin.py
-rw-r--r--  2.0 unx      148 b- defN 80-Jan-01 00:00 accounts/apps.py
-rw-r--r--  2.0 unx      444 b- defN 80-Jan-01 00:00 accounts/forms.py
-rw-r--r--  2.0 unx     8183 b- defN 80-Jan-01 00:00 accounts/models.py
-rw-r--r--  2.0 unx       63 b- defN 80-Jan-01 00:00 accounts/views.py
drwxr-xr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/
-rw-r--r--  2.0 unx        0 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/__init__.py
-rw-r--r--  2.0 unx      413 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/asgi.py
-rw-r--r--  2.0 unx      672 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/manage.py
-rw-r--r--  2.0 unx     3616 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/settings.py
-rw-r--r--  2.0 unx      760 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/urls.py
-rw-r--r--  2.0 unx      413 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/wsgi.py
8698 files, 76145711 bytes uncompressed, 24343880 bytes compressed:  68.0%
Please don't snip though, provide the whole thing if you can. Perhaps if it's too big share a gist.
b
Okay
e
This is more terse and may be just as useful:
Copy code
$ unzip -qc dist/fleetdatabaseFinal/production.pex PEX-INFO | python -mjson.tool
{
    "bootstrap_hash": "5ba276cd9f3b69e00c9cc8452f2c9a088d563169",
    "build_properties": {
        "pex_version": "2.1.108"
    },
    "code_hash": "a67d656564da2f12c547280536c36c2dd319f3d8",
    "distributions": {
        "Django-4.1.7-py3-none-any.whl": "ba7b3b60845048a44d2e41a4e4a52139aed31176b2358657f84b4e506efcde25",
        "asgiref-3.6.0-py3-none-any.whl": "1642f00ffd4cc6d15037edaf005143dac0cbfb3b5706a19c8c445d4c37e44714",
        "django_stubs-1.16.0-py3-none-any.whl": "a4bf54d6a236ca58ac8a030a2ff0c185f6b046bca9e41f4956db13c7452181cb",
        "django_stubs_ext-0.8.0-py3-none-any.whl": "2ab56185c9bfeb68e6b402504d119b9b39765dcffce4e50a6336150ee65f4dd4",
        "gunicorn-20.1.0-py3-none-any.whl": "48a8aa8894e1b47c4d7b44dba4b1adff054ea189e0708d789c3ba5cf2a485b0d",
        "mypy-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl": "3a77ba825efcfa70718bb63a2b4a564911087b1ce5df4182f5c0ac4a493909dd",
        "mypy_extensions-1.0.0-py3-none-any.whl": "322faffb2e4c7768d03d354528240ded8adea9dd0e6e67d998f275994c744cb5",
        "psycopg2_binary-2.9.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl": "0e86ed3a64a119448ae5b8ab84ff3e017497f8df51142306b59c00d65bc79771",
        "python_dotenv-1.0.0-py3-none-any.whl": "95f2de931cfa4f61f6af073b2599c9041079050e4848d46f0269405d4a09f015",
        "setuptools-67.7.2-py3-none-any.whl": "a7ab09e9ae2df05c17e47472bdb9b9a95306cc3b304b291269227db1adc71663",
        "sqlparse-0.4.4-py3-none-any.whl": "70a34696676a99a1d9b82e6ef75c22569e919c2b6cdd6e87a6a50b28b1fe5534",
        "tomli-2.0.1-py3-none-any.whl": "d19e7285b3847ab542b3e82242b35a4d185496ac1b6c6f0896d00a5fb599c4ed",
        "types_PyYAML-6.0.12.9-py3-none-any.whl": "88c1df13081ee980d22c704ef2d6a0c7fa35a614ee1c034ac53c794b4a702ca4",
        "types_pytz-2023.3.0.0-py3-none-any.whl": "77afe64369f5fd5368aa7ab394a45bee5fdd4b2a76c778994fa5d0cd5c0f0c94",
        "typing_extensions-4.5.0-py3-none-any.whl": "b46af7f121ca528ad7180c389d9ace75b11294dc75989f8d553eb6474bafadd8"
    },
    "emit_warnings": false,
    "entry_point": "gunicorn.app.wsgiapp:run",
    "ignore_errors": false,
    "includes_tools": false,
    "inherit_path": "prefer",
    "interpreter_constraints": [
        "CPython<3.10,>=3.9"
    ],
    "pex_hash": "fd3e0bf215c063beaf1dd4a7aa1efb8e3ea6d7c4",
    "pex_path": "",
    "pex_paths": [],
    "requirements": [
        "Django==4.1.7",
        "django-stubs>=1.10.0",
        "gunicorn",
        "psycopg2-binary",
        "python-dotenv>=0.20.0"
    ],
    "strip_pex_env": true,
    "venv": false,
    "venv_bin_path": "false",
    "venv_copies": false,
    "venv_site_packages_copies": false
}
If you can provide both that would be best actually @brash-area-42337
b
zipinfo.gist
Copy code
{
  "bootstrap_hash": "e2a4db25fedf8ae5456055b658df569b4ac69c8e",
  "build_properties": {
    "pex_version": "2.1.108"
  },
  "code_hash": "bcc83b14aec47c25cf3d0149ddf08ddbd3fc1d79",
  "distributions": {
    "Django-4.1.7-py3-none-any.whl": "ba7b3b60845048a44d2e41a4e4a52139aed31176b2358657f84b4e506efcde25",
    "asgiref-3.6.0-py3-none-any.whl": "1642f00ffd4cc6d15037edaf005143dac0cbfb3b5706a19c8c445d4c37e44714",
    "django_stubs-1.16.0-py3-none-any.whl": "a4bf54d6a236ca58ac8a030a2ff0c185f6b046bca9e41f4956db13c7452181cb",
    "django_stubs_ext-0.8.0-py3-none-any.whl": "2ab56185c9bfeb68e6b402504d119b9b39765dcffce4e50a6336150ee65f4dd4",
    "gunicorn-20.1.0-py3-none-any.whl": "48a8aa8894e1b47c4d7b44dba4b1adff054ea189e0708d789c3ba5cf2a485b0d",
    "mypy-1.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl": "a75731fc1dc38c52f83e89aa689ae46ee5d6ba7418adde52f81ab79cfe5d0713",
    "mypy_extensions-1.0.0-py3-none-any.whl": "322faffb2e4c7768d03d354528240ded8adea9dd0e6e67d998f275994c744cb5",
    "psycopg2_binary-2.9.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl": "0e86ed3a64a119448ae5b8ab84ff3e017497f8df51142306b59c00d65bc79771",
    "python_dotenv-1.0.0-py3-none-any.whl": "95f2de931cfa4f61f6af073b2599c9041079050e4848d46f0269405d4a09f015",
    "setuptools-67.6.1-py3-none-any.whl": "85125ef97280d307d2afe25f2cafe07a4d37f96d5799141b40638dca3c5c5218",
    "sqlparse-0.4.3-py3-none-any.whl": "1c051383ab5f49c75fe406bd30c5f21a9a7dad12149914d047fe50e50b4e2b8a",
    "tomli-2.0.1-py3-none-any.whl": "d19e7285b3847ab542b3e82242b35a4d185496ac1b6c6f0896d00a5fb599c4ed",
    "types_PyYAML-6.0.12.9-py3-none-any.whl": "88c1df13081ee980d22c704ef2d6a0c7fa35a614ee1c034ac53c794b4a702ca4",
    "types_pytz-2023.3.0.0-py3-none-any.whl": "77afe64369f5fd5368aa7ab394a45bee5fdd4b2a76c778994fa5d0cd5c0f0c94",
    "typing_extensions-4.5.0-py3-none-any.whl": "b46af7f121ca528ad7180c389d9ace75b11294dc75989f8d553eb6474bafadd8"
  },
  "emit_warnings": false,
  "entry_point": "gunicorn.app.wsgiapp:run",
  "ignore_errors": false,
  "includes_tools": false,
  "inherit_path": "prefer",
  "interpreter_constraints": [
    "CPython<3.10,>=3.9"
  ],
  "pex_hash": "a34be76e42ddd7714a845d93a7f634417effa491",
  "pex_path": "",
  "pex_paths": [],
  "requirements": [
    "Django==4.1.7",
    "django-stubs>=1.10.0",
    "gunicorn>=20.1.0",
    "psycopg2-binary",
    "python-dotenv"
  ],
  "strip_pex_env": true,
  "venv": false,
  "venv_bin_path": "false",
  "venv_copies": false,
  "venv_site_packages_copies": false
}
There you go
e
So, see here in yours at the bottom:
Copy code
-rw-rw-r--  2.0 unx     2379 b- defN 80-Jan-01 00:00 PEX-INFO
-rwxrwxr-x  2.0 unx     3503 b- defN 80-Jan-01 00:00 __main__.py
drwxrwxr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 __pex__/
-rw-rw-r--  2.0 unx     3477 b- defN 80-Jan-01 00:00 __pex__/__init__.py
drwxrwxr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/
-rw-r--r--  2.0 unx        0 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/__init__.py
drwxrwxr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/accounts/
-rw-r--r--  2.0 unx        0 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/accounts/__init__.py
-rw-r--r--  2.0 unx     4304 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/accounts/admin.py
-rw-r--r--  2.0 unx      148 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/accounts/apps.py
-rw-r--r--  2.0 unx      444 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/accounts/forms.py
-rw-r--r--  2.0 unx     8183 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/accounts/models.py
-rw-r--r--  2.0 unx       63 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/accounts/views.py
-rw-r--r--  2.0 unx      413 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/asgi.py
-rw-r--r--  2.0 unx      672 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/manage.py
-rw-r--r--  2.0 unx     3581 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/settings.py
-rw-r--r--  2.0 unx      760 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/urls.py
-rw-r--r--  2.0 unx      413 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/wsgi.py
And mine:
Copy code
-rw-r--r--  2.0 unx     2379 b- defN 80-Jan-01 00:00 PEX-INFO
-rwxr-xr-x  2.0 unx     3503 b- defN 80-Jan-01 00:00 __main__.py
drwxr-xr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 __pex__/
-rw-r--r--  2.0 unx     3477 b- defN 80-Jan-01 00:00 __pex__/__init__.py
drwxr-xr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 accounts/
-rw-r--r--  2.0 unx        0 b- defN 80-Jan-01 00:00 accounts/__init__.py
-rw-r--r--  2.0 unx     4304 b- defN 80-Jan-01 00:00 accounts/admin.py
-rw-r--r--  2.0 unx      148 b- defN 80-Jan-01 00:00 accounts/apps.py
-rw-r--r--  2.0 unx      444 b- defN 80-Jan-01 00:00 accounts/forms.py
-rw-r--r--  2.0 unx     8183 b- defN 80-Jan-01 00:00 accounts/models.py
-rw-r--r--  2.0 unx       63 b- defN 80-Jan-01 00:00 accounts/views.py
drwxr-xr-x  2.0 unx        0 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/
-rw-r--r--  2.0 unx        0 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/__init__.py
-rw-r--r--  2.0 unx      413 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/asgi.py
-rw-r--r--  2.0 unx      672 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/manage.py
-rw-r--r--  2.0 unx     3616 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/settings.py
-rw-r--r--  2.0 unx      760 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/urls.py
-rw-r--r--  2.0 unx      413 b- defN 80-Jan-01 00:00 fleetdatabaseFinal/wsgi.py
b
What could be the cause of this??
e
So you appear to be using an old PEX from a different branch maybe? You should try my test - docker compose is not the issue here - just run:
Copy code
$ pants package ::
$ dist/fleetdatabaseFinal/production.pex fleetdatabaseFinal.wsgi -- bind 0.0.0.0:5000
In the public repo you open sourced for me. Make sure that works 1st.
If that works, let me know. If it does not, please provide the zipinfo for that pex. Also - please check permissions! You are using
sudo
which is a ~horrible idea and it may be you have a very old
dist/
PEX file that is silently failing to be over-written when you run
pants package ::
.
b
It is actually running for the repo you have access to
But what I don't get is that it is the same code I just created a template that I made public
e
I don't believe you.
It has to be different.
At any rate - I think your problem is narrowed down now. You just need to understand what is different between the open sourced repo and your own. Something definitely is.
b
Definitely because I have clone the private repo again and it is still giving the same error
May be I give you access to the private repo so you can check it out and see
You can just help with your github
e
@brash-area-42337 respectfully, no. It will be a good learning exercise for you and your colleagues to figure out what's up here. I think I've vetted the Pants issues - the OSS repo is set up well. If you encounter a difference / issue in your investigation, it may be worth asking about what you find at that point in time.
b
Okay thanks for the help though....it really has helped. Let me handle the rest and figure out something. when i find out the issue, I will surely communicate it here and also write an article to help someone with similar issues
@enough-analyst-54434 thank you so much finally cleared the air. Just had to clone the same repo in a different directory on my machine and clear my docker cache so we are now running