snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.19k stars 3.2k forks source link

V5 latest "beta" issue ldap settings/ad sync #8500

Closed Joly0 closed 4 years ago

Joly0 commented 4 years ago

image

After updating develop to be up to date with the latest commits, i noticed some "bugs" in the ldap settings. I cleared everything before, config, view, route, even browser cache, but the "bug" is still there.

Joly0 commented 4 years ago

Oh, and testing ldap results in this image

Joly0 commented 4 years ago

Thats the error message `[2020-10-07 10:34:02] develop.ERROR: Exception: Can't contact LDAP server in C:\inetpub\wwwroot\snipe-it\vendor\adldap2\adldap2\src\Auth\Guard.php:102#19 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(170): Illuminate\Routing\Router->dispatch()

20 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(130): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}()

21 C:\inetpub\wwwroot\snipe-it\vendor\barryvdh\laravel-debugbar\src\Middleware\InjectDebugbar.php(65): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()

22 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle()

23 C:\inetpub\wwwroot\snipe-it\app\Http\Middleware\SecurityHeaders.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()

24 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): App\Http\Middleware\SecurityHeaders->handle()

25 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()

26 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()

27 C:\inetpub\wwwroot\snipe-it\app\Http\Middleware\CheckForDebug.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()

28 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): App\Http\Middleware\CheckForDebug->handle()

29 C:\inetpub\wwwroot\snipe-it\app\Http\Middleware\CheckForSetup.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()

30 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): App\Http\Middleware\CheckForSetup->handle()

31 C:\inetpub\wwwroot\snipe-it\vendor\fideloper\proxy\src\TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()

32 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Fideloper\Proxy\TrustProxies->handle()

33 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()

34 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Illuminate\View\Middleware\ShareErrorsFromSession->handle()

35 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php(56): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()

36 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Illuminate\Session\Middleware\StartSession->handle()

37 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()

38 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle()

39 C:\inetpub\wwwroot\snipe-it\vendor\barryvdh\laravel-cors\src\HandlePreflight.php(29): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()

40 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(171): Barryvdh\Cors\HandlePreflight->handle()

41 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()

42 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(145): Illuminate\Pipeline\Pipeline->then()

43 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()

44 C:\inetpub\wwwroot\snipe-it\public\index.php(58): Illuminate\Foundation\Http\Kernel->handle()

45 {main} `

Joly0 commented 4 years ago

Went back to 4.9.5 as described in my other issue, ldap sync and login works perfectly. Updated again to latest v5 beta, same settings, nothing changed, i get above errors

Joly0 commented 4 years ago

Oh, and my way older issue seems to still be an issue in v5. If i sync, all users are created with (NULL) in the permissions field in the database table. That means, that new users can login, but wont see anything, even if they are in a users group and their permissions should be inherited. Only after going to every single users settings and saving the permissions there, the permissions in the table get updated to the correct value setting everything to 0 as it happens when a user gets manually created.

uberbrady commented 4 years ago

There's a new GM you might want to try? - https://github.com/snipe/snipe-it/releases/tag/v5.0.0-beta-7-GM

This unfortunately won't affect your permissions issue, that might have to wait until we re-do the LDAP system after v5 comes out.

GitHub
Release v5.0.0-beta-7-GM · snipe/snipe-it
New from v5.0.0-beta-6 to v5.0.0-beta-7-GM This is the golden master for Snipe-IT v5. Primary in this release are some critical fixes for AD login. IMPORTANT: This version of Snipe-IT requires PHP ...
Joly0 commented 4 years ago

Hey @uberbrady sry for coming back to this so late, but was in vacation. I just upgraded my dev environment to 5.0.3 and still getting the above error.

Joly0 commented 4 years ago

btw a simple get-aduser powershell query works perfectly trying to get all user from the dev server with -server set to my domain, so its not a connection problem or wrong settings. The same settings still work fine in my 4.9.5 prod-instance

uberbrady commented 4 years ago

Welcome back! Hope your vacation was great. I've been working on an LDAP sync issue in #8563 but I'm not sure that's the same as your problem.

If you have more than 500 or so users in your directory, then that other issue may be the same as your problem.

If not, then something else is definitely going on. I'm hoping to have a fix out for the 'too many LDAP users' problem today, but that might not help you. If it doesn't, we'll drill down into your problem next and see what we can figure out.

Joly0 commented 4 years ago

No, if only the synced users are counted, then its not more then about 150 users. Even if everything is counted, it shouldnt be more then 500 entries in my ad. Is there a command or something to test the ldap functionallity outside of snipe, like i said with a powershell command i could "easily" execute? That could potentionally help identify the root of the problem. Additionally is there anything i can enable or change to get an even more precise log other then setting to debug mode?

uberbrady commented 4 years ago

"Can't contact LDAP server" is pretty low-level; if you can't contact it then that means that Snipe-IT's LDAP connect commands will not let you connect - any other test you would do would be the same.

Is it possible that this test server needs a port opened on some firewall? Some kind of IP address shenanigans?

I do have some experimental LDAP test scripts that are semi-inside-of, but semi-outside-of, Snipe-IT.

I'll see if I can push some of those up and maybe throw in some logging for you, on a custom branch, so we can try and suss this out.

Oh, and Debug Mode can definitely help here too (though it will display usernames/passwords in clear-text in your logs, so beware).

Joly0 commented 4 years ago

The dev server is in another vlan, but it has access to the main ad and sync worked, prior to v5 and as said with a simple powershell command aswell. Is it possible to get back to v4.9.5? If so, i would take a backup of the prod snipe-it instance, restore that onto the dev server so they are exact twins, update to v5 and see what happens.

Joly0 commented 4 years ago

Just tried the newest release, still same. Tried some suggestions from other issues like using the full ldap/ad-path of the ldap bind user, but didnt help either

Joly0 commented 4 years ago

Btw, this is still a problem even in the newest release. Snipe still cant comunicate with my AD and throws the error from above

uberbrady commented 4 years ago

If you run php upgrade.php on your instance, what output do you get? The latest version of that script (released formally in v5.0.7, but on master for a few days before that) has much more strict php module checking, and I wonder if it might help give us some troubleshooting information.

Joly0 commented 4 years ago

upgrade_first.txt upgrade_second.txt Ok, so i executed the upgrade.php script twice. The first output shows the normal update to the latest release and the second should be the output of the newer upgrade.php which gives the requested information.

snipe commented 4 years ago

Adding output to comment so I don’t have to keep downloading it to my iPad:

First:


Skipping user check as it is not supported on Windows
Welcome to the Snipe-IT upgrader.

Please note that this script will not download the latest Snipe-IT 
files for you unless you have git installed. 
It simply runs the standard composer and artisan 
commands needed to finalize the upgrade after. 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! If you have any encrypted custom fields, BE SURE TO run the recrypter if upgrading from v3 to v4. 
!! See the Snipe-IT documentation for help: 
!! https://snipe-it.readme.io/docs/upgrading-to-v4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------
STEP 1: Checking PHP requirements: 
--------------------------------------------------------

Current PHP version: 7.4.1

PHP version: 7.4.1 is at least 7.2.0 - continuing... 

--------------------------------------------------------
STEP 2: Backing up database: 
--------------------------------------------------------

-- Starting backup...
Dumping database snipeit...
Determining files to backup...
Zipping 173 files and directories...
Created zip containing 173 files and directories. Size is 199.65 KB
Copying zip to disk named backup...
Successfully copied zip to disk named backup.
Backup completed!

--------------------------------------------------------
STEP 3: Putting application into maintenance mode: 
--------------------------------------------------------

-- Application is already down.

--------------------------------------------------------
STEP 4: Pulling latest from Git (master branch): 
--------------------------------------------------------

Git is installed. 
-- -- No local changes to save
-- Your branch is behind 'origin/master' by 110 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
-- Updating 9e319e91d..9e30be8a0
Fast-forward
 .all-contributorsrc                                |  18 ++
 .env.example                                       |   1 +
 .gitignore                                         |   1 +
 .travis.yml                                        |  80 ---------
 README.md                                          |  15 +-
 .../Commands/FixMismatchedAssetsAndLogs.php        | 105 +++++++++++
 app/Console/Commands/MergeUsersByUsername.php      |   5 +-
 app/Console/Commands/MoveUploadsToNewDisk.php      |  48 ++---
 app/Console/Commands/ObjectImportCommand.php       |   6 +-
 app/Console/Commands/PurgeLoginAttempts.php        |  44 +++++
 app/Http/Controllers/Api/LocationsController.php   |   3 +-
 app/Http/Controllers/Api/SettingsController.php    |  48 ++++-
 .../Controllers/Api/StatuslabelsController.php     |  12 +-
 .../Controllers/AssetMaintenancesController.php    |   6 +-
 app/Http/Controllers/Auth/LoginController.php      |   1 +
 .../Components/ComponentsController.php            |   2 +-
 .../Licenses/LicenseFilesController.php            |   3 +-
 app/Http/Controllers/ReportsController.php         |  93 ++++++++++
 app/Http/Middleware/SecurityHeaders.php            |   2 +-
 app/Http/Requests/AssetFileRequest.php             |   2 +-
 app/Http/Transformers/LocationsTransformer.php     |   1 +
 app/Models/Asset.php                               |  14 +-
 app/Models/Category.php                            |   2 +
 app/Models/Location.php                            |   2 +-
 app/Notifications/CheckinAccessoryNotification.php |   4 +-
 app/Notifications/CheckinAssetNotification.php     |   4 +-
 .../CheckinLicenseSeatNotification.php             |   4 +-
 .../ExpectedCheckinAdminNotification.php           |   2 +-
 app/Notifications/ExpectedCheckinNotification.php  |  24 +--
 app/Presenters/LocationPresenter.php               |  11 +-
 app/Services/LdapAd.php                            |  75 ++++++--
 composer.json                                      |   1 +
 composer.lock                                      | 114 +++++++++++-
 config/mail-auto-embed.php                         |   2 +-
 config/version.php                                 |  10 +-
 public/css/dist/all.css                            | Bin 319269 -> 349925 bytes
 public/css/dist/skins/skin-black-dark.css          | Bin 8205 -> 8266 bytes
 public/css/dist/skins/skin-black-dark.min.css      | Bin 8198 -> 8259 bytes
 public/css/dist/skins/skin-green-dark.css          | Bin 8667 -> 8731 bytes
 public/css/dist/skins/skin-green-dark.min.css      | Bin 8660 -> 8724 bytes
 public/css/dist/skins/skin-orange-dark.css         | Bin 8360 -> 8424 bytes
 public/css/dist/skins/skin-orange-dark.min.css     | Bin 8353 -> 8417 bytes
 public/css/dist/skins/skin-purple-dark.css         | Bin 8360 -> 8424 bytes
 public/css/dist/skins/skin-purple-dark.min.css     | Bin 8353 -> 8417 bytes
 public/css/dist/skins/skin-red-dark.css            | Bin 8228 -> 8307 bytes
 public/css/dist/skins/skin-red-dark.min.css        | Bin 8221 -> 8300 bytes
 public/css/dist/skins/skin-yellow-dark.css         | Bin 8360 -> 8439 bytes
 public/css/dist/skins/skin-yellow-dark.min.css     | Bin 8353 -> 8432 bytes
 public/js/build/app.js                             | Bin 446909 -> 446805 bytes
 public/js/build/vendor.js                          | Bin 369406 -> 621535 bytes
 public/js/dist/all.js                              | Bin 816022 -> 1068047 bytes
 public/mix-manifest.json                           |  32 ++--
 .../js/components/importer/importer-file.vue       |   8 +-
 resources/assets/less/skins/skin-black-dark.less   |   6 +
 resources/assets/less/skins/skin-green-dark.less   |   6 +
 resources/assets/less/skins/skin-orange-dark.less  |   6 +
 resources/assets/less/skins/skin-purple-dark.less  |   6 +
 resources/assets/less/skins/skin-red-dark.less     |   6 +
 resources/assets/less/skins/skin-yellow-dark.less  |   6 +
 resources/lang/af/admin/settings/general.php       |   1 +
 resources/lang/af/general.php                      |  14 +-
 resources/lang/af/mail.php                         |   8 +-
 resources/lang/ar/admin/accessories/message.php    |   2 +-
 .../lang/ar/admin/asset_maintenances/general.php   |   6 +-
 resources/lang/ar/admin/hardware/table.php         |   2 +-
 resources/lang/ar/admin/kits/general.php           |  26 +--
 resources/lang/ar/admin/licenses/message.php       |   2 +-
 resources/lang/ar/admin/settings/general.php       |  89 +++++-----
 resources/lang/ar/admin/statuslabels/table.php     |   2 +-
 resources/lang/ar/admin/users/general.php          |   2 +-
 resources/lang/ar/admin/users/message.php          |   2 +-
 resources/lang/ar/auth/general.php                 |   2 +-
 resources/lang/ar/auth/message.php                 |  16 +-
 resources/lang/ar/button.php                       |   2 +-
 resources/lang/ar/general.php                      |  50 +++---
 resources/lang/ar/help.php                         |  18 +-
 resources/lang/ar/mail.php                         |  22 ++-
 resources/lang/bg/admin/settings/general.php       |   1 +
 resources/lang/bg/general.php                      |  14 +-
 resources/lang/bg/mail.php                         |   8 +-
 resources/lang/cs/admin/settings/general.php       |   1 +
 resources/lang/cs/general.php                      |  14 +-
 resources/lang/cs/mail.php                         |   8 +-
 resources/lang/cy/admin/settings/general.php       |   1 +
 resources/lang/cy/general.php                      |  14 +-
 resources/lang/cy/mail.php                         |   8 +-
 resources/lang/da/admin/settings/general.php       |   1 +
 resources/lang/da/general.php                      |  14 +-
 resources/lang/da/mail.php                         |   8 +-
 resources/lang/de/admin/hardware/table.php         |   2 +-
 resources/lang/de/admin/kits/general.php           |  24 +--
 resources/lang/de/admin/licenses/message.php       |   2 +-
 resources/lang/de/admin/settings/general.php       |  67 +++----
 resources/lang/de/admin/settings/message.php       |   2 +-
 resources/lang/de/admin/users/general.php          |   2 +-
 resources/lang/de/admin/users/message.php          |   2 +-
 resources/lang/de/auth/general.php                 |   2 +-
 resources/lang/de/auth/message.php                 |  16 +-
 resources/lang/de/button.php                       |   2 +-
 resources/lang/de/general.php                      |  48 ++---
 resources/lang/de/help.php                         |  16 +-
 resources/lang/de/mail.php                         |  22 ++-
 resources/lang/el/admin/settings/general.php       |   1 +
 resources/lang/el/general.php                      |  14 +-
 resources/lang/el/mail.php                         |   8 +-
 resources/lang/en-GB/admin/settings/general.php    |   1 +
 resources/lang/en-GB/general.php                   |  14 +-
 resources/lang/en-GB/mail.php                      |   8 +-
 resources/lang/en-ID/admin/settings/general.php    |   1 +
 resources/lang/en-ID/general.php                   |  14 +-
 resources/lang/en-ID/mail.php                      |   8 +-
 resources/lang/en/admin/settings/general.php       |   1 +
 resources/lang/en/general.php                      |  14 +-
 resources/lang/en/mail.php                         |   8 +-
 resources/lang/es-CO/admin/settings/general.php    |   1 +
 resources/lang/es-CO/general.php                   |  14 +-
 resources/lang/es-CO/mail.php                      |   8 +-
 resources/lang/es-ES/admin/settings/general.php    |   1 +
 resources/lang/es-ES/admin/users/table.php         |   2 +-
 resources/lang/es-ES/general.php                   |  14 +-
 resources/lang/es-ES/mail.php                      |   8 +-
 resources/lang/es-MX/admin/hardware/table.php      |   2 +-
 resources/lang/es-MX/admin/kits/general.php        |  10 +-
 resources/lang/es-MX/admin/licenses/message.php    |   2 +-
 resources/lang/es-MX/admin/settings/general.php    |  13 +-
 resources/lang/es-MX/admin/users/table.php         |   2 +-
 resources/lang/es-MX/general.php                   |  14 +-
 resources/lang/es-MX/mail.php                      |   8 +-
 resources/lang/es-VE/admin/settings/general.php    |   1 +
 resources/lang/es-VE/general.php                   |  16 +-
 resources/lang/es-VE/mail.php                      |   8 +-
 resources/lang/et/admin/settings/general.php       |   1 +
 resources/lang/et/general.php                      |  14 +-
 resources/lang/et/mail.php                         |   8 +-
 resources/lang/fa/admin/settings/general.php       |   1 +
 resources/lang/fa/general.php                      |  14 +-
 resources/lang/fa/mail.php                         |   8 +-
 resources/lang/fi/admin/settings/general.php       |   1 +
 resources/lang/fi/general.php                      |  14 +-
 resources/lang/fi/mail.php                         |   8 +-
 resources/lang/fil/admin/settings/general.php      |   1 +
 resources/lang/fil/general.php                     |  14 +-
 resources/lang/fil/mail.php                        |   8 +-
 resources/lang/fr/admin/hardware/table.php         |   2 +-
 resources/lang/fr/admin/kits/general.php           |  24 +--
 resources/lang/fr/admin/licenses/message.php       |   2 +-
 resources/lang/fr/admin/settings/general.php       |  73 ++++----
 resources/lang/fr/admin/users/general.php          |   2 +-
 resources/lang/fr/admin/users/message.php          |   2 +-
 resources/lang/fr/auth/general.php                 |   2 +-
 resources/lang/fr/auth/message.php                 |  16 +-
 resources/lang/fr/button.php                       |   2 +-
 resources/lang/fr/general.php                      |  48 ++---
 resources/lang/fr/help.php                         |  10 +-
 resources/lang/fr/mail.php                         |  22 ++-
 resources/lang/ga-IE/admin/settings/general.php    |   1 +
 resources/lang/ga-IE/general.php                   |  14 +-
 resources/lang/ga-IE/mail.php                      |   8 +-
 resources/lang/he/admin/settings/general.php       |   3 +-
 resources/lang/he/admin/statuslabels/table.php     |   2 +-
 resources/lang/he/admin/users/general.php          |   2 +-
 resources/lang/he/general.php                      |  24 +--
 resources/lang/he/mail.php                         |   8 +-
 resources/lang/hr/admin/settings/general.php       |   1 +
 resources/lang/hr/general.php                      |  14 +-
 resources/lang/hr/mail.php                         |   8 +-
 resources/lang/hu/admin/settings/general.php       |   1 +
 resources/lang/hu/general.php                      |  14 +-
 resources/lang/hu/mail.php                         |   8 +-
 resources/lang/id/admin/settings/general.php       |   1 +
 resources/lang/id/general.php                      |  14 +-
 resources/lang/id/mail.php                         |   8 +-
 resources/lang/is/admin/settings/general.php       |   1 +
 resources/lang/is/general.php                      |  14 +-
 resources/lang/is/mail.php                         |   8 +-
 resources/lang/it/admin/hardware/table.php         |   2 +-
 resources/lang/it/admin/kits/general.php           |  24 +--
 resources/lang/it/admin/licenses/message.php       |   2 +-
 resources/lang/it/admin/settings/general.php       |  63 +++----
 resources/lang/it/admin/users/general.php          |   2 +-
 resources/lang/it/admin/users/message.php          |   2 +-
 resources/lang/it/auth/general.php                 |   2 +-
 resources/lang/it/auth/message.php                 |  16 +-
 resources/lang/it/button.php                       |   2 +-
 resources/lang/it/general.php                      |  48 ++---
 resources/lang/it/mail.php                         |  22 ++-
 resources/lang/iu/admin/settings/general.php       |   1 +
 resources/lang/iu/general.php                      |  14 +-
 resources/lang/iu/mail.php                         |   8 +-
 resources/lang/ja/admin/hardware/table.php         |   2 +-
 resources/lang/ja/admin/licenses/message.php       |   2 +-
 resources/lang/ja/admin/settings/general.php       |  33 ++--
 resources/lang/ja/admin/users/general.php          |   2 +-
 resources/lang/ja/admin/users/message.php          |   2 +-
 resources/lang/ja/general.php                      |  14 +-
 resources/lang/ja/mail.php                         |   8 +-
 resources/lang/ko/admin/settings/general.php       |   1 +
 resources/lang/ko/general.php                      |  14 +-
 resources/lang/ko/mail.php                         |   8 +-
 resources/lang/lt/admin/settings/general.php       |   1 +
 resources/lang/lt/general.php                      |  14 +-
 resources/lang/lt/mail.php                         |   8 +-
 resources/lang/lv/admin/settings/general.php       |   1 +
 resources/lang/lv/general.php                      |  14 +-
 resources/lang/lv/mail.php                         |   8 +-
 resources/lang/mi/admin/settings/general.php       |   1 +
 resources/lang/mi/general.php                      |  14 +-
 resources/lang/mi/mail.php                         |   8 +-
 resources/lang/mk/admin/settings/general.php       |   1 +
 resources/lang/mk/general.php                      |  14 +-
 resources/lang/mk/mail.php                         |   8 +-
 resources/lang/ml-IN/admin/settings/general.php    |   1 +
 resources/lang/ml-IN/general.php                   |  14 +-
 resources/lang/ml-IN/mail.php                      |   8 +-
 resources/lang/mn/admin/settings/general.php       |   1 +
 resources/lang/mn/general.php                      |  14 +-
 resources/lang/mn/mail.php                         |   8 +-
 resources/lang/ms/admin/settings/general.php       |   1 +
 resources/lang/ms/general.php                      |  14 +-
 resources/lang/ms/mail.php                         |   8 +-
 resources/lang/nl/admin/accessories/general.php    |   4 +-
 resources/lang/nl/admin/accessories/message.php    |   6 +-
 .../lang/nl/admin/asset_maintenances/general.php   |   8 +-
 .../lang/nl/admin/asset_maintenances/message.php   |  16 +-
 .../lang/nl/admin/asset_maintenances/table.php     |   4 +-
 resources/lang/nl/admin/categories/general.php     |   6 +-
 resources/lang/nl/admin/categories/table.php       |   2 +-
 resources/lang/nl/admin/components/general.php     |   4 +-
 resources/lang/nl/admin/components/message.php     |  12 +-
 resources/lang/nl/admin/consumables/general.php    |   2 +-
 resources/lang/nl/admin/consumables/message.php    |   4 +-
 resources/lang/nl/admin/custom_fields/general.php  |   2 +-
 resources/lang/nl/admin/depreciations/general.php  |   6 +-
 resources/lang/nl/admin/hardware/form.php          |  26 +--
 resources/lang/nl/admin/hardware/general.php       |  30 ++--
 resources/lang/nl/admin/hardware/message.php       |  53 +++---
 resources/lang/nl/admin/hardware/table.php         |   6 +-
 resources/lang/nl/admin/kits/general.php           |  22 +--
 resources/lang/nl/admin/licenses/form.php          |   6 +-
 resources/lang/nl/admin/licenses/general.php       |   2 +-
 resources/lang/nl/admin/licenses/message.php       |   8 +-
 resources/lang/nl/admin/licenses/table.php         |   2 +-
 resources/lang/nl/admin/locations/message.php      |   2 +-
 resources/lang/nl/admin/locations/table.php        |   4 +-
 resources/lang/nl/admin/manufacturers/table.php    |   4 +-
 resources/lang/nl/admin/models/general.php         |  14 +-
 resources/lang/nl/admin/models/message.php         |   6 +-
 resources/lang/nl/admin/models/table.php           |  14 +-
 resources/lang/nl/admin/reports/general.php        |   2 +-
 resources/lang/nl/admin/settings/general.php       | 107 ++++++------
 resources/lang/nl/admin/statuslabels/message.php   |  10 +-
 resources/lang/nl/admin/statuslabels/table.php     |   6 +-
 resources/lang/nl/admin/suppliers/message.php      |   2 +-
 resources/lang/nl/admin/suppliers/table.php        |   6 +-
 resources/lang/nl/admin/users/general.php          |  10 +-
 resources/lang/nl/admin/users/message.php          |  14 +-
 resources/lang/nl/admin/users/table.php            |   4 +-
 resources/lang/nl/auth/general.php                 |   2 +-
 resources/lang/nl/auth/message.php                 |  16 +-
 resources/lang/nl/button.php                       |   4 +-
 resources/lang/nl/general.php                      | 108 ++++++------
 resources/lang/nl/mail.php                         |  57 +++---
 resources/lang/nl/table.php                        |   2 +-
 resources/lang/no/admin/settings/general.php       |   1 +
 resources/lang/no/general.php                      |  14 +-
 resources/lang/no/mail.php                         |   8 +-
 resources/lang/pl/admin/settings/general.php       |   1 +
 resources/lang/pl/general.php                      |  14 +-
 resources/lang/pl/mail.php                         |   8 +-
 resources/lang/pt-BR/admin/kits/general.php        |  22 +--
 resources/lang/pt-BR/admin/settings/general.php    |   1 +
 resources/lang/pt-BR/general.php                   |  14 +-
 resources/lang/pt-BR/mail.php                      |   8 +-
 resources/lang/pt-PT/admin/kits/general.php        |  16 +-
 resources/lang/pt-PT/admin/settings/general.php    |   1 +
 resources/lang/pt-PT/general.php                   |  14 +-
 resources/lang/pt-PT/mail.php                      |   8 +-
 resources/lang/ro/admin/settings/general.php       |   1 +
 resources/lang/ro/general.php                      |  14 +-
 resources/lang/ro/mail.php                         |   8 +-
 resources/lang/ru/admin/settings/general.php       |   1 +
 resources/lang/ru/general.php                      |  14 +-
 resources/lang/ru/mail.php                         |   8 +-
 resources/lang/sl/admin/settings/general.php       |   1 +
 resources/lang/sl/general.php                      |  14 +-
 resources/lang/sl/mail.php                         |   8 +-
 resources/lang/sr-CS/admin/settings/general.php    |   1 +
 resources/lang/sr-CS/general.php                   |  14 +-
 resources/lang/sr-CS/mail.php                      |   8 +-
 resources/lang/sv-SE/admin/hardware/table.php      |   2 +-
 resources/lang/sv-SE/admin/settings/general.php    |   1 +
 resources/lang/sv-SE/admin/users/message.php       |   2 +-
 resources/lang/sv-SE/general.php                   |  14 +-
 resources/lang/sv-SE/mail.php                      |   8 +-
 resources/lang/ta/admin/settings/general.php       |   1 +
 resources/lang/ta/general.php                      |  14 +-
 resources/lang/ta/mail.php                         |   8 +-
 resources/lang/th/admin/hardware/table.php         |   2 +-
 resources/lang/th/admin/licenses/message.php       |   2 +-
 resources/lang/th/admin/settings/general.php       |   5 +-
 resources/lang/th/general.php                      |  18 +-
 resources/lang/th/mail.php                         |   8 +-
 resources/lang/tl/admin/settings/general.php       |   1 +
 resources/lang/tl/general.php                      |  14 +-
 resources/lang/tl/mail.php                         |   8 +-
 resources/lang/tr/admin/hardware/table.php         |   2 +-
 resources/lang/tr/admin/licenses/message.php       |   2 +-
 resources/lang/tr/admin/settings/general.php       |  23 +--
 resources/lang/tr/general.php                      |  14 +-
 resources/lang/tr/mail.php                         |   8 +-
 resources/lang/uk/admin/settings/general.php       |   1 +
 resources/lang/uk/general.php                      |  14 +-
 resources/lang/uk/mail.php                         |   8 +-
 resources/lang/ur-PK/admin/settings/general.php    |   1 +
 resources/lang/ur-PK/general.php                   |  14 +-
 resources/lang/ur-PK/mail.php                      |   8 +-
 resources/lang/vi/admin/settings/general.php       |   1 +
 resources/lang/vi/general.php                      |  14 +-
 resources/lang/vi/mail.php                         |   8 +-
 resources/lang/zh-CN/admin/settings/general.php    |   1 +
 resources/lang/zh-CN/general.php                   |  14 +-
 resources/lang/zh-CN/mail.php                      |   8 +-
 resources/lang/zh-HK/admin/settings/general.php    |   1 +
 resources/lang/zh-HK/general.php                   |  14 +-
 resources/lang/zh-HK/mail.php                      |   8 +-
 resources/lang/zh-TW/admin/settings/general.php    |   1 +
 resources/lang/zh-TW/general.php                   |  14 +-
 resources/lang/zh-TW/mail.php                      |   8 +-
 resources/lang/zu/admin/settings/general.php       |   1 +
 resources/lang/zu/general.php                      |  14 +-
 resources/lang/zu/mail.php                         |   8 +-
 resources/macros/macros.php                        |   5 +-
 resources/views/account/accept-asset.blade.php     |  10 +-
 resources/views/asset_maintenances/edit.blade.php  |   2 +-
 .../views/custom_fields/fieldsets/view.blade.php   |   5 +-
 resources/views/hardware/view.blade.php            |  27 ++-
 resources/views/importer/import.blade.php          |   9 +-
 resources/views/layouts/default.blade.php          |   2 +-
 resources/views/locations/view.blade.php           |   7 +-
 resources/views/manufacturers/edit.blade.php       |   2 +-
 resources/views/models/edit.blade.php              |   2 +-
 .../markdown/asset-requested.blade.php             |   2 +-
 .../markdown/checkin-accessory.blade.php           |   2 +-
 .../notifications/markdown/checkin-asset.blade.php |   2 +-
 .../markdown/checkin-license.blade.php             |   2 +-
 .../markdown/checkout-accessory.blade.php          |   2 +-
 .../markdown/checkout-asset.blade.php              |   2 +-
 .../markdown/checkout-consumable.blade.php         |   2 +-
 .../markdown/checkout-license.blade.php            |   2 +-
 .../markdown/expected-checkin.blade.php            |  20 +++
 .../markdown/report-expected-checkins.blade.php    |   2 +-
 .../markdown/report-expiring-licenses.blade.php    |  19 +-
 .../partials/forms/edit/model-select.blade.php     |   4 +-
 resources/views/reports/activity.blade.php         |   7 +
 resources/views/reports/depreciation.blade.php     |   4 +-
 .../views/reports/unaccepted_assets.blade.php      |   3 +-
 resources/views/settings/general.blade.php         |   6 +-
 resources/views/settings/ldap.blade.php            | 106 +++++++++++
 resources/views/settings/saml.blade.php            |   2 +-
 resources/views/settings/slack.blade.php           |  12 +-
 resources/views/suppliers/edit.blade.php           |   2 +-
 resources/views/users/edit.blade.php               | 118 +++++++------
 resources/views/users/view.blade.php               |   6 +-
 resources/views/vendor/mail/html/message.blade.php |   2 +-
 routes/web.php                                     |   3 +
 snipeit.sh                                         |   2 +-
 upgrade.php                                        | 194 ++++++++++++++-------
 webpack.mix.js                                     |   3 +-
 368 files changed, 2749 insertions(+), 1546 deletions(-)
 delete mode 100644 .travis.yml
 create mode 100644 app/Console/Commands/FixMismatchedAssetsAndLogs.php
 create mode 100644 app/Console/Commands/PurgeLoginAttempts.php
 create mode 100644 resources/views/notifications/markdown/expected-checkin.blade.php
--------------------------------------------------------
Step 5: Cleaning up old cached files:
--------------------------------------------------------

-- No bootstrap/cache/compiled.php, so nothing to delete.
-- Deleting bootstrap/cache/services.php. It it no longer used.
-- No bootstrap/cache/config.php, so nothing to delete.
-- Configuration cache cleared!
-- Application cache cleared!
-- Route cache cleared!
-- Compiled views cleared!

--------------------------------------------------------
Step 6: Updating composer dependencies:
(This may take a moment.)
--------------------------------------------------------

-- We couldn't find a local composer.phar - trying globally.

Generating optimized autoload files
Generated optimized autoload files containing 5499 classes

--------------------------------------------------------
Step 7: Migrating database:
--------------------------------------------------------

-- Nothing to migrate.

--------------------------------------------------------
Step 8: Checking for OAuth keys:
--------------------------------------------------------

- OAuth keys detected. Skipping passport install.

--------------------------------------------------------
Step 9: Caching routes and config:
--------------------------------------------------------

-- Configuration cache cleared!
Configuration cached successfully!
-- Route cache cleared!
Routes cached successfully!

--------------------------------------------------------
Step 10: Taking application out of maintenance mode:
--------------------------------------------------------

-- Application is now live.

--------------------------------------------------------
FINISHED! Clear your browser cookies and re-login to use :
your upgraded Snipe-IT.
--------------------------------------------------------

Second:

Skipping user check as it is not supported on Windows
--------------------------------------------------------
WELCOME TO THE SNIPE-IT UPGRADER! 
--------------------------------------------------------

This script will attempt to: 

- check your PHP version and extension requirements 
- do a git pull to bring you to the latest version 
- run composer install to get your vendors up to date 
- run migrations to get your schema up to date 
- clear out old cache settings

--------------------------------------------------------
STEP 1: Checking PHP requirements: 
--------------------------------------------------------

Current PHP version: (7.4.1) is at least 7.2.0 - continuing... 
FYI: The php.ini used by this PHP is: C:\Program Files\PHP\v7.4\php.ini

Checking Required PHP extensions... 

√ bcmath is installed!
√ curl is installed!
√ fileinfo is installed!
√ gd is installed!
√ json is installed!
√ ldap is installed!
√ mbstring is installed!
√ mysqli is installed!
√ openssl is installed!
√ PDO is installed!
√ tokenizer is installed!
√ xml is installed!
√ zip is installed!

--------------------------------------------------------
STEP 2: Backing up database: 
--------------------------------------------------------

-- Starting backup...
Dumping database snipeit...
Determining files to backup...
Zipping 173 files and directories...
Created zip containing 173 files and directories. Size is 199.65 KB
Copying zip to disk named backup...
Successfully copied zip to disk named backup.
Backup completed!

--------------------------------------------------------
STEP 3: Putting application into maintenance mode: 
--------------------------------------------------------

-- Application is now in maintenance mode.

--------------------------------------------------------
STEP 4: Pulling latest from Git (master branch): 
--------------------------------------------------------

Git is installed. 
-- No local changes to save
-- Your branch is up to date with 'origin/master'.
-- Already up to date.

--------------------------------------------------------
Step 5: Cleaning up old cached files:
--------------------------------------------------------

√ No bootstrap/cache/compiled.php, so nothing to delete.
√ No bootsrap/cache/services.php, so nothing to delete.
√ Deleting bootstrap/cache/config.php. It is no longer used.

-- Configuration cache cleared!
-- Application cache cleared!
-- Route cache cleared!
-- Compiled views cleared!

--------------------------------------------------------
Step 6: Updating composer dependencies:
(This may take a moment.)
--------------------------------------------------------

-- We couldn't find a local composer.phar. No worries, trying globally.

Generating optimized autoload files
Generated optimized autoload files containing 5499 classes

--------------------------------------------------------
Step 7: Migrating database:
--------------------------------------------------------

Nothing to migrate.

--------------------------------------------------------
Step 8: Checking for OAuth keys:
--------------------------------------------------------

√ OAuth keys detected. Skipping passport install.

--------------------------------------------------------
Step 9: Taking application out of maintenance mode:
--------------------------------------------------------

-- Application is now live.

---------------------- FINISHED! -----------------------
All done! Clear your browser cookies and re-login to use 
your upgraded Snipe-IT!
--------------------------------------------------------
snipe commented 4 years ago

What version does it say in the footer of your Snipe-IT now? And did upgrading affect your original issue at all?

Joly0 commented 4 years ago

Version v5.0.7 - build 5615 (master) and the original problem still persists. Snipe-IT cant connect to the ldap server

Joly0 commented 4 years ago

Just a question, does snipeit support something like openid connect?

snipe commented 4 years ago

@Joly0 We support LDAP/AD login and SAML currently.

Unless you're getting a new LDAP error, as @uberbrady mentioned, "Can't contact LDAP server" is pretty low-level; if you can't contact it then that means that Snipe-IT's LDAP connect commands will not let you connect - any other test you would do would be the same. It means it's either a misconfiguration of your LDAP settings or a networking issue. It means we can't even talk to the the LDAP server at all.

Joly0 commented 4 years ago

Cant be any of them. It worked on the latest 4er release and nothing other then the upgrade changed on that system or the network. With a simple powershell command i am able to get the desired information from the ad

snipe commented 4 years ago

You're welcome to roll back to 4.9.5 then, but it seems highly unlikely to me that this is an issue on our end. If we can't even talk to your LDAP server, we obviously cannot sync to it or use it to login.

Joly0 commented 4 years ago

If you have any other idea on how i can change my configuration? I already tried different variations of the base bind dn and the bind username aswell as other ips for the ldap server field or domains in the active directory domain. Rolling back to 4.9.5 would not help as this is a dev environment specifically for testing new releases. The Production environment ist still on 4.9.5 but i would like to be able to update it aswell to 5, so i wont end up using outdated and probably someday unsupported versions and the lpad sync problem is, atm, the only problem that blocks the update

uberbrady commented 4 years ago

I guess I have a couple of ideas left, but we are definitely running low here.

I think on Windows you can get a telnet client (I think it's in the windows features dialog somewhere). Snag that, then try to telnet from your Snipe-IT server to your LDAP server, port 389 and port 636. telnet hostname port. If you get an immediate "connection refused" then you have a networking problem.

Next, let's take a look at your LDAP settings - try and paste us a screenshot here - make sure to redact out anything secret. Maybe we can find some smoking gun.

Joly0 commented 4 years ago

I figured the root of the problem and tbh... shame on me. The problem is the ldap server adress. In the previous versions, although it said to add ldap:// in front of the ip, the ip alone worked perfectly, and i think it didnt work when i added that, cause its an ad server, not an ldap server, bur cant confirm that statement now. So i didnt bother thinking about adding that to the ip address when updating to v5, but it turns out in v5 is necessary to add ldap:// before the ip of the ldap server. Added it and it instantly worked. Can connect to the ad server and users can sync and login without a problem and it seems even my old problem with wrong user permissions and group permissions being applied is fixed, although i have to test this a bit further.

uberbrady commented 4 years ago

Awesome! We should probably error on that a little cleaner, for certain. If it's not a valid LDAP url, then it's not a valid LDAP url, period.

Joly0 commented 4 years ago

Just a quick question as i want to make sure the update on my production instance will go flawless, i would like to downgrade the dev instance from 5.0.7 to 4.9.5. How can i do this? I am using git/php upgrade installation method Previously i could use php upgrade develop or php upgrade master to switch between branches, but it seems not to be working with tags. Do i have to manually downgrade?