datajoint-python icon indicating copy to clipboard operation
datajoint-python copied to clipboard

Cannot follow developer set up instructions

Open rly opened this issue 1 year ago • 2 comments

Bug Report

Description

I am trying to follow the set up instructions to contribute a pull request but failing. Using https://datajoint.com/docs/core/datajoint-python/0.14/develop/ , when I try to use the cloud-based IDE and run tests, I get:

E   pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'fakeservices.datajoint.io' ([Errno 111] Connection refused)")

Indeed, trying to log in to mysql using the example command gives:

@rly ➜ /workspaces/datajoint-python (fix_change_password) $ mysql -hfakeservices.datajoint.io -uroot -psimple
ERROR 2002 (HY000): Can't connect to MySQL server on 'fakeservices.datajoint.io' (115)

Is fakeservices.datajoint.io not running, or is this a placeholder?

So then I tried the local IDE set up. When trying to reopen the folder in the Dev container in VS Code, I get the following error within the massive log file:

[2023-09-02T09:55:35.798Z] Obtaining file:///workspaces/datajoint-python
[2023-09-02T09:55:35.901Z]   Preparing metadata (setup.py) ... -
[2023-09-02T09:55:35.915Z]  error
[2023-09-02T09:55:35.916Z]   error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 28, in <module>
        File "/usr/local/lib/python3.7/tokenize.py", line 447, in open
          buffer = _builtin_open(filename, 'rb')
      PermissionError: [Errno 1] Operation not permitted: '/workspaces/datajoint-python/setup.py'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
[2023-09-02T09:55:35.917Z] error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I don't know what's wrong there.

Reproducibility

Include:

  • OS (WIN | MACOS | Linux) GitHub Codespaces / macOS M1
  • Python Version OR MATLAB Version n/a
  • MySQL Version n/a
  • MySQL Deployment Strategy (local-native | local-docker | remote) n/a
  • DataJoint Version latest commit on master branch
  • Minimum number of steps to reliably reproduce the issue
  • Complete error stack as a result of evaluating the above steps

Expected Behavior

Be able to launch a development environment using the given instructions.

rly avatar Sep 02 '23 10:09 rly

Hi @rly, thank you for this report.

  1. For the first error, it looks like the postStartCommand does not run and thereby does not bring up the MySQL server. I am able to replicate this error locally and on Codespaces. I will look into this issue.

  2. I am not able to replicate the second error, but I will ensure that the development environment is capable of building and running locally.

kabilar avatar Sep 09 '23 18:09 kabilar

I followed the developer instructions that suggest the Dev Containers extension. After some start-up time, I see the following in my VSCode terminal:

Successfully installed datajoint
[notice] A new release of pip is available: 23.0.1 -> 23.3.1
[notice] To update, run: pip install --upgrade pip
Running the postStartCommand from devcontainer.json...

[212295 ms] Start: Run in container: /bin/sh -c MYSQL_VER=8.0 MINIO_VER=RELEASE.2022-08-11T04-37-28Z docker compose -f local-docker-compose.yml down && docker volume prune -f && MYSQL_VER=8.0 MINIO_VER=RELEASE.2022-08-11T04-37-28Z docker compose -f local-docker-compose.yml up --build --wait
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[216091 ms] postStartCommand failed with exit code 1. Skipping any further user-provided commands.
Done. Press any key to close the terminal.

Pressing a button seems to continue the setup process

[277057 ms] Port forwarding 54962 > 33227 > 33227: Local close
[523080 ms] Start: Run in container: cat /proc/2208/environ

But opening a new terminal in the same VSCode session, I'm not able to connect to the server

vscode ➜ /workspaces/datajoint-python (master) $ nosetests -vw tests_old/
[2023-10-25 17:26:08,613][INFO]: Connecting [email protected]:3306
Failure: OperationalError ((2003, "Can't connect to MySQL server on 'fakeservices.datajoint.io' ([Errno 111] Connection refused)")) ... ERROR

CBroz1 avatar Oct 25 '23 17:10 CBroz1