Repository: Kovah/LinkAce (language: php)

Issue:
Update to v2.1.2 breaks instance.
### Bug Description

I updated to the newest release, and everything goes according to the documentation, but after opening the site and logging in I get an error 500.

docker compose logs -f 

> app-1    | ::1 -  15/Feb/2025:16:43:18 +0000 "GET /index.php" 500

I then enabled the debug mode in .env and got the following error message: 

> Tried loading settings 'App\Settings\UserSettings', and the following properties were missing: share_bluesky

Stack trace:

```
Spatie\LaravelSettings\Exceptions\MissingSettings:
Tried loading settings 'App\Settings\UserSettings', and the following properties were missing: share_bluesky

  at /app/vendor/spatie/laravel-settings/src/Exceptions/MissingSettings.php:13
  at Spatie\LaravelSettings\Exceptions\MissingSettings::create('App\\Settings\\UserSettings', array('share_bluesky'), 'loading')
     (/app/vendor/spatie/laravel-settings/src/SettingsMapper.php:122)
  at Spatie\LaravelSettings\SettingsMapper->ensureNoMissingSettings(object(SettingsConfig), object(Collection), 'loading')
     (/app/vendor/spatie/laravel-settings/src/SettingsMapper.php:42)
  at Spatie\LaravelSettings\SettingsMapper->load('App\\Settings\\UserSettings')
     (/app/vendor/spatie/laravel-settings/src/Settings.php:277)
  at Spatie\LaravelSettings\Settings->loadValues()
     (/app/vendor/spatie/laravel-settings/src/Settings.php:128)
  at Spatie\LaravelSettings\Settings->__isset('timezone')
     (/app/app/Helper/functions.php:50)
  at usersettings('timezone')
     (/app/app/Http/Middleware/SettingsMiddleware.php:25)
  at App\Http\Middleware\SettingsMiddleware->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:50)
  at Illuminate\Routing\Middleware\SubstituteBindings->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:78)
  at Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49)
  at Illuminate\View\Middleware\ShareErrorsFromSession->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:121)
  at Illuminate\Session\Middleware\StartSession->handleStatefulRequest(object(Request), object(EncryptedStore), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:64)
  at Illuminate\Session\Middleware\StartSession->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37)
  at Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:67)
  at Illuminate\Cookie\Middleware\EncryptCookies->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:119)
  at Illuminate\Pipeline\Pipeline->then(object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php:805)
  at Illuminate\Routing\Router->runRouteWithinStack(object(Route), object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php:784)
  at Illuminate\Routing\Router->runRoute(object(Request), object(Route))
     (/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php:748)
  at Illuminate\Routing\Router->dispatchToRoute(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php:737)
  at Illuminate\Routing\Router->dispatch(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:200)
  at Illuminate\Foundation\Http\Kernel->{closure:Illuminate\Foundation\Http\Kernel::dispatchToRouter():197}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:144)
  at Illuminate\Pipeline\Pipeline->{closure:Illuminate\Pipeline\Pipeline::prepareDestination():142}(object(Request))
     (/app/app/Http/Middleware/SetupCheckMiddleware.php:55)
  at App\Http\Middleware\SetupCheckMiddleware->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31)
  at Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:40)
  at Illuminate\Foundation\Http\Middleware\TrimStrings->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27)
  at Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:99)
  at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php:49)
  at Illuminate\Http\Middleware\HandleCors->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:39)
  at Illuminate\Http\Middleware\TrustProxies->handle(object(Request), object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():158}:159}(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:119)
  at Illuminate\Pipeline\Pipeline->then(object(Closure))
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:175)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(object(Request))
     (/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144)
  at Illuminate\Foundation\Http\Kernel->handle(object(Request))
     (/app/public/index.php:54)            
```


### How to reproduce

1. I updated my docker instance to v2.1.2 according to this: https://www.linkace.org/docs/v2/upgrade/ 

### Expected behavior

no errors ;)

### Logs

```shell

```

### Screenshots

_No response_

### LinkAce version

v2.1.2

### Setup Method

Docker

### Operating System

Linux (Ubuntu, CentOS,...)

### Client details

- Ubuntu Server 22.04 LTS all packages updated


Discussion / hints:
database missing entry:
table settings
was added
guest	share_bluesky	0

miss the row:
user-X	share_bluesky	0
Beat me to it, was going to post the same. Worth mentioning (even though it's implicit in your post) that the migration went well. It's clear something hsa slipped through, because it's not able to find something related to bluesky which is a newly added feature.
Same here. I even tried a new installation. 
Hi,

it looks like there is an bug in the migration script. It adds a new settings "shareAdd_bluesky", which is wrong.
The correct name of the setting is share_bluesky. For my guest user the mirgation was correct, but not for my 
other users.

I cloud fix it with the following SQL Command at my linkace mySQL Database:

`update settings set name='share_bluesky' where name='shareAdd_bluesky';`

After that I could load linkace as expected.

Cheers kiwix


Hi @Kovah 

It looks like the bug is in line #12 of
database/settings/2025_02_15_092008_add_bluesky_share_method.php

Cheers
KiwiX



> I cloud fix it with the following SQL Command at my linkace mySQL Database:
> 
> `update settings set name='share_bluesky' where name='shareAdd_bluesky';`

Thank you so much, it is running again!

`docker exec -it linkace-db-1 mariadb -u linkace -p -D linkace -e "update settings set name='share_bluesky' where name='shareAdd_bluesky';"`

for anyone who is wondering, like I was ;)

Fix patch:
diff --git a/database/settings/2025_02_15_092008_add_bluesky_share_method.php b/database/settings/2025_02_15_092008_add_bluesky_share_method.php
index 5889431b..399f4d61 100644
--- a/database/settings/2025_02_15_092008_add_bluesky_share_method.php
+++ b/database/settings/2025_02_15_092008_add_bluesky_share_method.php
@@ -9,7 +9,7 @@ public function up(): void
 
         foreach (DB::table('users')->pluck('id') as $userId) {
             $id = 'user-' . $userId;
-            $this->migrator->add($id . '.shareAdd_bluesky', false);
+            $this->migrator->add($id . '.share_bluesky', false);
         }
     }
 };


Test patch: