Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#35164 closed Bug (invalid)

PermissionError: Permission denied: site-packages

Reported by: milahu Owned by: nobody
Component: Database layer (models, ORM) Version: 5.0
Severity: Normal Keywords: database migrations
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

continue https://github.com/django/django/pull/17816

currently, django is trying to write database migration files
to the path of the app based on django

apps based on django can be installed in read-only paths
and then, django should not throw a fatal error

site-packages should be treated as read-only
runtime state belongs to $HOME/.cache/

felixxm has no interest in supporting this use case
i have no time for pointless discussions about obvious bugs
so "let someone else solve this problem"...

Change History (4)

comment:1 by Mariusz Felisiak, 8 months ago

Resolution: invalid
Status: newclosed

Again, it is an issue in a 3rd party packages missed including migrations for some model changes. You should report this to their issue tracker.

Version 0, edited 8 months ago by Mariusz Felisiak (next)

comment:2 by Simon Charette, 8 months ago

felixxm has no interest in supporting this use case i have no time for pointless discussions about obvious bugs so "let someone else solve this problem"...

If makemigrations is attempting to generate migrations for packages installed in your environment it's a symptom of a large problem and thus it doesn't justify the patch you're proposing.

Mariusz is rightfully doing so and pointed you in the right direction. Please take a moment to introspect your approach in suggesting changes without providing details on how to reproduce your problem. These are not pointless discussions and you should expect to engage in such talks if you expect maintainers to consider your changes for inclusion and maintenance for the years to come.

comment:3 by milahu, 8 months ago

If makemigrations is attempting to generate migrations for packages installed in your environment it's a symptom of a large problem

https://github.com/django/django/pull/17816#issuecomment-1925362445

It seems that one of your 3rd party packages missed including migrations for some model changes

yes, i modified the app, but i did not include the new migration file

django throwing a fatal error here is "too much"

django should store the new migration file somewhere, where the user can find it
show an info (or warning) and continue running the app

then, what the user does with that new migration file, is his business

comment:4 by Natalia Bidart, 8 months ago

Dear milahu,

As mentioned by two Django maintainers, your use case is not supported by Django: having 3rd party apps installed as dependencies and then modified locally producing alterations that require new migrations is an anti-pattern. You are, of course, free to make the decision of continuing doing so, but please be mindful that Django will not include fixes for these cases because it's not an usage pattern that we want to encourage.

If you need to modify a 3rd party app generating the need of new migrations, the recommended path forward is to either reach out to the 3rd party app maintainers, or fork the library if you have the permissions to do so and make a new release of the library including the migration, so it's installed in your dev environment with a clean and complete state.

If you still have questions, the best place to get more answers to your issue is using any of the user support channels from this link.

Note: See TracTickets for help on using tickets.
Back to Top