Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [inny][Laravel5] Wywala czasami 500 Internal Server Error
styryl
post
Post #1





Grupa: Zarejestrowani
Postów: 223
Pomógł: 27
Dołączył: 16.04.2008
Skąd: Bakutilu

Ostrzeżenie: (0%)
-----


Problem występuje gdy wykonuje się szybko wiele requestów w krótkim czasie (IMG:style_emoticons/default/arrowheadsmiley.png) aby lepiej zobrazować o co chodzi screen:

(IMG:http://i60.tinypic.com/20fpzyc.jpg)

Nie wiem jak dokładnie opisać ten problem. Dodam że wyszło to przy rest api do którego podłączonych jest wielu klientów z tego samego adresu ip. Nawet przy świeżej instalacji laravela bez żadnych zmian dzieje się to samo. Problem ten nie występuje w laravel 4.2. Czy to jest wina frameworka? Czy też problem jest po stronie konfiguracji serwera?

Ten post edytował styryl 26.06.2015, 11:13:37
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 17)
Pyton_000
post
Post #2





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Logi php mówią że... (IMG:style_emoticons/default/questionmark.gif)

Ten post edytował Pyton_000 26.06.2015, 11:52:32
Go to the top of the page
+Quote Post
styryl
post
Post #3





Grupa: Zarejestrowani
Postów: 223
Pomógł: 27
Dołączył: 16.04.2008
Skąd: Bakutilu

Ostrzeżenie: (0%)
-----


Logi php mówią że, przy czym klucz jest ustawiony poprawnie.

  1. [2015-06-26 09:54:10] local.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Encryption\Encryptio
    nServiceProvider.php:29
  2. Stack trace:
  3. #0 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(733): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array)
  4. #1 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(626): Illuminate\Container\Container->build(Object(Closure), Array)
  5. #2 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Foundation\Applica
    tion.php(674): Illuminate\Container\Container->make('encrypter', Array)
  6. #3 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(837): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
  7. #4 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(800): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
  8. #5 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(771): Illuminate\Container\Container->getDependencies(Array, Array)
  9. #6 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(626): Illuminate\Container\Container->build('App\\Http\\Middle...', Array)
  10. #7 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Foundation\Applica
    tion.php(674): Illuminate\Container\Container->make('App\\Http\\Middle...', Array)
  11. #8 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.
    php(123): Illuminate\Foundation\Application->make('App\\Http\\Middle...')
  12. #9 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Foundation\Http\Mi
    ddleware\CheckForMaintenanceMode.php(42): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  13. #10 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
  14. #11 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.
    php(124): call_user_func_array(Array, Array)
  15. #12 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
  16. #13 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.
    php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
  17. #14 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Foundation\Http\Ke
    rnel.php(118): Illuminate\Pipeline\Pipeline->then(Object(Closure))
  18. #15 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Foundation\Http\Ke
    rnel.php(86): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
  19. #16 C:\xampp\htdocs\test5\public\index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
  20. #17 {main}
  21. [2015-06-26 09:54:10] local.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Encryption\Encryptio
    nServiceProvider.php:29
  22. Stack trace:
  23. #0 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(733): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array)
  24. #1 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(626): Illuminate\Container\Container->build(Object(Closure), Array)
  25. #2 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Foundation\Applica
    tion.php(674): Illuminate\Container\Container->make('encrypter', Array)
  26. #3 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(837): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
  27. #4 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(800): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
  28. #5 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(771): Illuminate\Container\Container->getDependencies(Array, Array)
  29. #6 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Container\Containe
    r.php(626): Illuminate\Container\Container->build('App\\Http\\Middle...', Array)
  30. #7 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Foundation\Applica
    tion.php(674): Illuminate\Container\Container->make('App\\Http\\Middle...', Array)
  31. #8 C:\xampp\htdocs\test5\vendor\laravel\framework\src\Illuminate\Foundation\Http\Ke
    rnel.php(135): Illuminate\Foundation\Application->make('App\\Http\\Middle...')
  32. #9 C:\xampp\htdocs\test5\public\index.php(58): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
  33. #10 {main}


W głównej aplikacji wyrzuca też notFoundException (oczywiście też przy wielu szybkich requstach)

Ten post edytował styryl 26.06.2015, 11:59:42
Go to the top of the page
+Quote Post
Pyton_000
post
Post #4





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Spróbuj ustawić w .env

APP_KEY=xlhF31NeOlibJcoOW9tvZg7TkHcAZI3a

(lub cokolwiek 32 znaki)
Go to the top of the page
+Quote Post
styryl
post
Post #5





Grupa: Zarejestrowani
Postów: 223
Pomógł: 27
Dołączył: 16.04.2008
Skąd: Bakutilu

Ostrzeżenie: (0%)
-----


Tak też na początku myślałem, ustawiłem, generowałem ponownie, wklejałem beżpośednio do configa. I efekt ten sam.
Go to the top of the page
+Quote Post
nrm
post
Post #6





Grupa: Zarejestrowani
Postów: 627
Pomógł: 33
Dołączył: 1.05.2005
Skąd: Katowice

Ostrzeżenie: (0%)
-----


dziwna sytuacja, rozumiem, że cipher => AES-256-CBC, a jakbyś zmienił na 128 i sprawdził 16znakowy hash? php artisan key:generate
Go to the top of the page
+Quote Post
Pyton_000
post
Post #7





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Wygląda to tak jakby Laravel nie mógł odczytać kluczy z configu, lub funkcja env() nie wyrabia

Rozumiem że jeśli odpalisz normalnie czyli 1 request to działa normalnie?
Go to the top of the page
+Quote Post
styryl
post
Post #8





Grupa: Zarejestrowani
Postów: 223
Pomógł: 27
Dołączył: 16.04.2008
Skąd: Bakutilu

Ostrzeżenie: (0%)
-----


@nrm To samo, tylko tak jak pisałem wcześniej, czasami wywala też \Symfony\Component\HttpKernel\Exception\NotFoundHttpException więc raczej kwestia klucza to nie będzie.

@Pyton_000 Tak przy jednym requescie działa normalnie, tylko przy wielu zaczynają się jaja - oczywiście laravel 4.2 działa bez preblemu więc chyba z serwerem jest wszystko ok.

Ten post edytował styryl 26.06.2015, 12:18:36
Go to the top of the page
+Quote Post
Pyton_000
post
Post #9





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Spróbuj postawić to na jakimś innym serwerze, bo wygląda jakby się dławił.

I te requesty wykonujesz Ajax-em co 20ms?
Go to the top of the page
+Quote Post
styryl
post
Post #10





Grupa: Zarejestrowani
Postów: 223
Pomógł: 27
Dołączył: 16.04.2008
Skąd: Bakutilu

Ostrzeżenie: (0%)
-----


Próbowałem już na 2 serwerach, normalnie zapytania wychodzą po http get/post z aplikacji zewnętrznej:

- - [26/Jun/2015:12:43:14 +0200] "GET /smsy/api/v1/sms/task/get?imei=860-------855 HTTP/1.0" 200 155 "-" "Mozilla/3.0 (compatible; Indy Library)"
- - [26/Jun/2015:12:43:14 +0200] "POST /smsy/api/v1/sms/task/status HTTP/1.0" 200 12 "-" "Mozilla/3.0 (compatible; Indy Library)"

Ja to zasymulowałem w firebugu szybko odświeżając strone (IMG:style_emoticons/default/thumbsupsmileyanim.gif)

Ten post edytował styryl 26.06.2015, 12:27:08
Go to the top of the page
+Quote Post
Pyton_000
post
Post #11





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Czyli robiłeś F5 ?
Go to the top of the page
+Quote Post
styryl
post
Post #12





Grupa: Zarejestrowani
Postów: 223
Pomógł: 27
Dołączył: 16.04.2008
Skąd: Bakutilu

Ostrzeżenie: (0%)
-----


Tak (IMG:style_emoticons/default/wstydnis.gif)
Go to the top of the page
+Quote Post
Pyton_000
post
Post #13





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


(IMG:style_emoticons/default/facepalmxd.gif) (IMG:style_emoticons/default/sciana.gif) (IMG:style_emoticons/default/blink.gif)

A słyszał ty o benchmarkach typu ab ?
https://pl.wikipedia.org/wiki/ApacheBench
Go to the top of the page
+Quote Post
styryl
post
Post #14





Grupa: Zarejestrowani
Postów: 223
Pomógł: 27
Dołączył: 16.04.2008
Skąd: Bakutilu

Ostrzeżenie: (0%)
-----


Słyszał, ale co to zmieni skoro ten sam błąd uzyskuje.
Go to the top of the page
+Quote Post
Pyton_000
post
Post #15





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


pokaż zrzut z AB
Go to the top of the page
+Quote Post
styryl
post
Post #16





Grupa: Zarejestrowani
Postów: 223
Pomógł: 27
Dołączył: 16.04.2008
Skąd: Bakutilu

Ostrzeżenie: (0%)
-----


ab -n 100 -c 10

(IMG:http://i62.tinypic.com/t0l2sz.jpg)
Go to the top of the page
+Quote Post
Pyton_000
post
Post #17





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


masz odrzuconych tylko 8 requestów

To teraz pokaż metodę wywoływaną.
Go to the top of the page
+Quote Post
styryl
post
Post #18





Grupa: Zarejestrowani
Postów: 223
Pomógł: 27
Dołączył: 16.04.2008
Skąd: Bakutilu

Ostrzeżenie: (0%)
-----


Niestety nie mogę udostępnić kodu publicznie, powtórzyłem ab na innym roucie:

  1. public function getLogin()
  2. {
  3. return View::make($this->viewPath.'.getLogin',[
  4. 'path' => 'core.backend.getLogin',
  5. 'jsPath' => 'modules/core/backend.login'
  6. ]);
  7. }


(IMG:http://i57.tinypic.com/iw4vth.jpg)

Chyba problem rozwiązany, wgrałem poprawkę i obserwuję - na sztywno ustawiłem wszystkie ustawienia nie wykorzystując env(), tak jak wpomniał Pyton_000 funkcja chyba nie do końca działa.


Ten post edytował styryl 26.06.2015, 13:48:35
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 03:53