Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] admin password reset #15

Closed
1 task done
stefangweichinger opened this issue Sep 18, 2023 · 19 comments
Closed
1 task done

[BUG] admin password reset #15

stefangweichinger opened this issue Sep 18, 2023 · 19 comments

Comments

@stefangweichinger
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Since I migrated my backup from the legacy container and logged in successfully it happened twice to me that the admin-login doesn't work anymore.

Expected Behavior

admin password shouldn't fail

Steps To Reproduce

  1. export backup from old unifi-container
  2. setup stack with new container as advised
  3. import backup
  4. login successfully with admin and known password (as in old stack)
  5. time goes by
  6. admin login fails

Environment

- OS: host: Debian 12.1
- How docker service was installed: apt

CPU architecture

x86-64

Docker creation

docker-compose file as in:

https://www.reddit.com/r/Ubiquiti/comments/16e8608/comment/k13f4yv/?utm_source=share&utm_medium=web2x&context=3

Container logs

-
@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@stefangweichinger
Copy link
Author

Additional question:

on friday I tried to reset the password by logging into mongo, and find the admin in the DB "ace". That DB does not exist in the new stack. pls advise which user to search for etc. thanks

@thespad
Copy link
Member

thespad commented Sep 18, 2023

The database is whatever you called the database when you set up the containers. If you copy/pasted our examples it's probably unifi.

@stefangweichinger
Copy link
Author

@thespad yes ;-) I agree.

I already tried that, but couldn't find the admin-account.

Should this find the account:

# docker-compose exec mongodb bash
root@50d6dcda1885:/# 
root@50d6dcda1885:/# mongo
MongoDB shell version v4.4.24
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("68164fb2-55c2-4324-adbc-b5dee593123b") }
MongoDB server version: 4.4.24
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
	https://docs.mongodb.com/
Questions? Try the MongoDB Developer Community Forums
	https://community.mongodb.com
---
The server generated these startup warnings when booting: 
        2023-09-16T20:20:04.732+00:00: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem
        2023-09-16T20:20:06.373+00:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
        2023-09-16T20:20:06.374+00:00: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'
---
> 
> use unifi
switched to db unifi
> db.admin.find()
> 
> 

? thanks for any help on this

@thespad
Copy link
Member

thespad commented Sep 18, 2023

It should. I'm using mongosh because I'm on a newer version but the principle should be the same.

localhost> use unifi
switched to db unifi
unifi> db.admin.find()
[
  {
    _id: ObjectId("5717c285cd9070f06f9d8d91"),

etc.

You should also be able to do

localhost> show dbs
admin       132.00 KiB
config      116.00 KiB
local        72.00 KiB
unifi         6.01 MiB
unifi_stat   99.09 MiB

To confirm everything is as you expect there.

@stefangweichinger
Copy link
Author

I can use a newer mongodb, I just followed the docs telling that 4.4 works (and newer releases should ... ).
Just tell me, I can start over with this stack. Maybe this also solves my password issue.

> use unifi
switched to db unifi
> db.admin.find()
> 
> 
> show dbs
admin       0.000GB
config      0.000GB
local       0.000GB
unifi       0.001GB
unifi_stat  0.000GB

thanks so far

@thespad
Copy link
Member

thespad commented Sep 18, 2023

There's no need to use a newer version, other than your position on support. Ubiquiti currently supports up to 4.4 and Mongo currently supports 4.4 up to 7.0. However, 4.4 is only supported until February 2024.

So you can go with the fully supported version, but only for 6 months, or you can go with a newer version of mongodb that isn't formally supported by Ubiquiti yet but will be supported by Mongo.

In theory you can do in place upgrades across major versions of mongodb, but the further back you go the messier that is to achieve. Personally I'm using the 7.0 tag, but any major version .0 tag should be fairly safe update-wise.

@stefangweichinger
Copy link
Author

Thanks for the details. So I'd prefer to stay with 4.4 for now.
Although that doesn't tell me where my admin-user is gone to ;-)

@thespad
Copy link
Member

thespad commented Sep 18, 2023

Do

use unifi
show collections

And see if you get anything returned at all.

@thespad
Copy link
Member

thespad commented Sep 18, 2023

Though given the sizes reported by show dbs it looks like there's nothing anywhere.

@stefangweichinger
Copy link
Author

I do

> use unifi
switched to db unifi
> show collections
account
admin
admin_access_log
alarm
alert
alert_setting
apgroup
appstate_log
crashlog
dashboard
device
dhcpoption
diagnostics_config
dpiapp
dpigroup
dynamicdns
event
featuremigration
firewallgroup
firewallrule
guest
heatmap
heatmappoint
hotspot2conf
hotspotop
hotspotpackage
ipsalert
map
networkconf
payment
portalfile
portconf
portforward
privilege
radiusprofile
rogue
rogueknown
routing
scheduletask
setting
site
spatialrecord
ssooauthtoken
stat
tag
task
teleport_client
teleport_token
threat_log_view
traffic_route
traffic_rule
trigger_log
user
usergroup
verification
virtualdevice
voucher
wall
wifiman_feedback
wireguard_user
wlanconf
wlangroup

@thespad
Copy link
Member

thespad commented Sep 18, 2023

So the admin collection exists at least.

@stefangweichinger
Copy link
Author

Well, also the admin-user existed. I restarted the stack now and followed docker-compose logs.
No new lines when I enter the creds in the login page. And login fails.

That login definitely worked on friday. I tested it, the customer tested it.

I can do more lookups, queries and provided details .. thanks

@stefangweichinger
Copy link
Author

For the records: currently using lscr.io/linuxserver/unifi-network-application:7.5.174

@stefangweichinger
Copy link
Author

Please advise how to continue.
Doing the import of the old backup again into a fresh stack won't make much difference as far as I understand.
thanks

@thespad
Copy link
Member

thespad commented Sep 19, 2023

I'm not sure what's causing your issue in the first place, unless you're doing something silly like storing your mongo database volume on NFS. The unifi database (obviously) shouldn't just spontaneously wipe itself.

@stefangweichinger
Copy link
Author

No NFS, just plain local docker volumes. I think I wait for tag 7.5.176 and retry.

@stefangweichinger stefangweichinger mentioned this issue Sep 21, 2023
1 task
@stefangweichinger
Copy link
Author

went back to old stack ... for now

@drizuid
Copy link
Member

drizuid commented Oct 11, 2023

OP reverted due to the issues their setup was causing them.
we also support the container, not the applications, so this issue would be out of scope for us. Best-effort help is available in #other-support on our discord. Closing this.

@drizuid drizuid closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2023
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants