membermatters / MemberMatters

An open source membership, access and payments portal for makerspaces and community groups.
https://membermatters.org
MIT License
40 stars 23 forks source link

Clean install fails to work. #184

Closed zztubedogzz closed 1 year ago

zztubedogzz commented 1 year ago

Performing a clean install on a clean installed server results in a redirect loop to /login page.

To Reproduce Steps to reproduce the behavior: From a clean boot:

  1. Install docker
    apt install docker docker-compose
  2. Pull the image
    docker pull membermatters/membermatters
  3. Create the env.list file used later
    mkdir /usr/app
    nano /usr/app/env.list
  4. Paste the contents
    # /usr/app/env.list
    PORTAL_ENV=Production
  5. Create container
    docker create -p 8000:8000 --name membermatters --restart always --env-file /usr/app/env.list -v /usr/app/:/usr/src/data membermatters/membermatters
  6. Start container
    docker start membermatters
  7. Open your favorite browser
  8. Login with default credentials
    Email: default@example.com
    Password: MemberMatters!
  9. Login successfull
  10. Go back to step 8.

Expected behavior After login you will be logged in and greated with the application.

Server Hetzner cloud VPS - Ubuntu 20.04 LTS image

Let me know where do I mess up. Thanks in advance. I also tried to install next to ISPConfig server running portainer with docker via GUI

Frigyes06 commented 1 year ago

can reproduce, except I get wrong username/password second time I try to log in.

Frigyes06 commented 1 year ago

Errors from my log:

INFO: Detected a first time run. Populating the database with defaults.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/django/db/models/options.py", line 608, in get_field
    return self.fields_map[field_name]
KeyError: 'member_type'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/django/core/serializers/json.py", line 70, in Deserializer
    yield from PythonDeserializer(objects, **options)
  File "/usr/local/lib/python3.10/site-packages/django/core/serializers/python.py", line 119, in Deserializer
    field = Model._meta.get_field(field_name)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/options.py", line 610, in get_field
    raise FieldDoesNotExist("%s has no field named '%s'" % (self.object_name, field_name))
django.core.exceptions.FieldDoesNotExist: Profile has no field named 'member_type'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/app/memberportal/manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 78, in handle
    self.loaddata(fixture_labels)
  File "/usr/local/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 123, in loaddata
    self.load_label(fixture_label)
  File "/usr/local/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 181, in load_label
    for obj in objects:
  File "/usr/local/lib/python3.10/site-packages/django/core/serializers/json.py", line 74, in Deserializer
    raise DeserializationError() from exc
django.core.serializers.base.DeserializationError: Problem installing fixture '/usr/src/app/memberportal/profile/fixtures/initial.json':
zztubedogzz commented 1 year ago

can reproduce, except I get wrong username/password second time I try to log in.

Same for me I missed that part.

jabelone commented 1 year ago

sorry about that @zztubedogzz and @Frigyes06 and for the delayed response!

Errors from my log:


INFO: Detected a first time run. Populating the database with defaults.
...
django.core.exceptions.FieldDoesNotExist: Profile has no field named 'member_type'

This looks like an older bug that should already be fixed but has not made its way into a release yet. I'll prepare to do a release shortly which will resolve this, and will keep this open until then. Meanwhile if you're keen, you could build a docker image from the latest main branch.

jabelone commented 1 year ago

Hey @zztubedogzz and @Frigyes06 can you please give the v3.1.0 release a try? You'll need to remove the setupcomplete text file if it exists, and make sure you pull the latest docker image.

https://github.com/membermatters/MemberMatters/releases/tag/v3.1.0 https://hub.docker.com/r/membermatters/membermatters/tags

beardedfool commented 1 year ago

By coincidence I was just giving this a go and the fix works for me, thanks Jaimyn

jabelone commented 1 year ago

Awesome I'll close this for now then. Feel free to let me know if you have any further problems. :)