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

"Error interno" en el acceso a la API #1767

Closed
supkk opened this issue Oct 19, 2021 · 1 comment
Closed

"Error interno" en el acceso a la API #1767

supkk opened this issue Oct 19, 2021 · 1 comment

Comments

@supkk
Copy link

supkk commented Oct 19, 2021

sysPass Version
3.2 (322.21031301)

Describe the question
He actualizado a syspass 3.2.2 desde la version 2.1.6 sin mayores problemas. Ahora estoy probando la API, pero no consigo tener acceso a ella. Ejecuto el comando:

curl.exe -v -k --header 'Accept: /' --header 'Cache-Control: no-cache' --header 'Content-Type: application/json' --request POST --data '{ "jsonrpc": "2.0", "method": "account/search", "params": { "authToken": "XXXXXXXX" }, "id": "1" }' https://XXXXXX/api.php

Y la respuesta es un 404. Esta es la traza de curl:

  • Trying 192.168.56.109:443...
  • Connected to 192.168.56.109 (192.168.56.109) port 443 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • TLSv1.3 (IN), TLS handshake, Server hello (2):
  • TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
  • TLSv1.3 (IN), TLS handshake, Certificate (11):
  • TLSv1.3 (IN), TLS handshake, CERT verify (15):
  • TLSv1.3 (IN), TLS handshake, Finished (20):
  • TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
  • TLSv1.3 (OUT), TLS handshake, Finished (20):
  • SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
  • ALPN, server accepted to use http/1.1
  • Server certificate:
  • subject: C=US; O=Unspecified; CN=localhost.localdomain; emailAddress=[email protected]
  • start date: Oct 19 09:59:57 2021 GMT
  • expire date: Oct 24 11:39:57 2022 GMT
  • issuer: C=US; O=Unspecified; OU=ca-309399369482672654; CN=localhost.localdomain; emailAddress=[email protected]
  • SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.

POST /api.php HTTP/1.1
Host: 192.168.56.109
User-Agent: curl/7.73.0
Accept: /
Cache-Control: no-cache
Content-Type: application/json
Content-Length: 136

  • upload completely sent off: 136 out of 136 bytes
  • TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
  • TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
  • old SSL session ID is stale, removing
  • Mark bundle as not supporting multiuse
    < HTTP/1.1 404 Not Found
    < Date: Tue, 19 Oct 2021 12:13:01 GMT
    < Server: Apache/2.4.37 (centos) OpenSSL/1.1.1g
    < X-Powered-By: PHP/7.3.20
    < Transfer-Encoding: chunked
    < Content-Type: text/html; charset=UTF-8
    <
    File not found.
  • Connection #0 to host 192.168.56.109 left intact

En el log de syspass aparece la siguiente cadena de errores:

[2021-10-19 12:17:18] syspass.EXCEPTION: logger {"message":"Context not initialized
#0 /var/www/html/syspass/lib/SP/Core/Context/ContextBase.php(143): SP\Core\Context\ContextBase->checkContext()
#1 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(100): SP\Core\Context\ContextBase->getContextKey(String,NULL)
#2 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(392): SP\Core\Context\SessionContext->getContextKey(String)
#3 /var/www/html/syspass/lib/SP/Core/Language.php(211): SP\Core\Context\SessionContext->getLocale()
#4 /var/www/html/syspass/lib/SP/Providers/Log/LoggerBase.php(78): SP\Core\Language->setAppLocales()
#5 /var/www/html/syspass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Log\LoggerBase->updateEvent(String,Object(SP\Core\Events\Event))
#6 /var/www/html/syspass/lib/SP/Services/Upgrade/UpgradeConfigService.php(216): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#7 /var/www/html/syspass/lib/SP/Bootstrap.php(423): SP\Services\Upgrade\UpgradeConfigService->upgrade(String,Object(SP\Config\ConfigData))
#8 /var/www/html/syspass/lib/SP/Bootstrap.php(397): SP\Bootstrap->checkConfigVersion()
#9 /var/www/html/syspass/lib/SP/Bootstrap.php(300): SP\Bootstrap->initConfig()
#10 /var/www/html/syspass/lib/SP/Bootstrap.php(227): SP\Bootstrap->initializeCommon()
#11 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#12 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(879): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#13 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#14 /var/www/html/syspass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#15 /var/www/html/syspass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#16 /var/www/html/syspass/index.php(28): require(String)","caller":"N/A"}

[2021-10-19 12:17:18] syspass.EXCEPTION: logger {"message":"Contexto no inicializado
#0 /var/www/html/syspass/lib/SP/Core/Context/ContextBase.php(143): SP\Core\Context\ContextBase->checkContext()
#1 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(100): SP\Core\Context\ContextBase->getContextKey(String,Object(SP\Services\User\UserLoginResponse))
#2 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(232): SP\Core\Context\SessionContext->getContextKey(String,Object(SP\Services\User\UserLoginResponse))
#3 /var/www/html/syspass/lib/SP/Providers/Log/LoggerBase.php(80): SP\Core\Context\SessionContext->getUserData()
#4 /var/www/html/syspass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Log\LoggerBase->updateEvent(String,Object(SP\Core\Events\Event))
#5 /var/www/html/syspass/lib/SP/Services/Upgrade/UpgradeConfigService.php(216): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#6 /var/www/html/syspass/lib/SP/Bootstrap.php(423): SP\Services\Upgrade\UpgradeConfigService->upgrade(String,Object(SP\Config\ConfigData))
#7 /var/www/html/syspass/lib/SP/Bootstrap.php(397): SP\Bootstrap->checkConfigVersion()
#8 /var/www/html/syspass/lib/SP/Bootstrap.php(300): SP\Bootstrap->initConfig()
#9 /var/www/html/syspass/lib/SP/Bootstrap.php(227): SP\Bootstrap->initializeCommon()
#10 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#11 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(879): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#12 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#13 /var/www/html/syspass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#14 /var/www/html/syspass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#15 /var/www/html/syspass/index.php(28): require(String)","caller":"N/A"}

[2021-10-19 12:17:18] syspass.DEBUG: upgrade.config.start {"message":"Actualizar Configuración","user":"N/A","address":"192.168.56.107","caller":"SP\Services\Upgrade\UpgradeConfigService::upgrade"} []

[2021-10-19 12:17:18] syspass.EXCEPTION: logger {"message":"Contexto no inicializado
#0 /var/www/html/syspass/lib/SP/Core/Context/ContextBase.php(143): SP\Core\Context\ContextBase->checkContext()
#1 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(100): SP\Core\Context\ContextBase->getContextKey(String,NULL)
#2 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(392): SP\Core\Context\SessionContext->getContextKey(String)
#3 /var/www/html/syspass/lib/SP/Core/Language.php(224): SP\Core\Context\SessionContext->getLocale()
#4 /var/www/html/syspass/lib/SP/Providers/Log/LoggerBase.php(104): SP\Core\Language->unsetAppLocales()
#5 /var/www/html/syspass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Log\LoggerBase->updateEvent(String,Object(SP\Core\Events\Event))
#6 /var/www/html/syspass/lib/SP/Services/Upgrade/UpgradeConfigService.php(216): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#7 /var/www/html/syspass/lib/SP/Bootstrap.php(423): SP\Services\Upgrade\UpgradeConfigService->upgrade(String,Object(SP\Config\ConfigData))
#8 /var/www/html/syspass/lib/SP/Bootstrap.php(397): SP\Bootstrap->checkConfigVersion()
#9 /var/www/html/syspass/lib/SP/Bootstrap.php(300): SP\Bootstrap->initConfig()
#10 /var/www/html/syspass/lib/SP/Bootstrap.php(227): SP\Bootstrap->initializeCommon()
#11 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#12 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(879): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#13 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#14 /var/www/html/syspass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#15 /var/www/html/syspass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#16 /var/www/html/syspass/index.php(28): require(String)","caller":"N/A"}

[2021-10-19 12:17:18] syspass.ERROR: logger {"message":"Could not set locale","caller":"SP\Core\Language::setLocales"}

[2021-10-19 12:17:18] syspass.EXCEPTION: logger {"message":"Context not initialized
#0 /var/www/html/syspass/lib/SP/Core/Context/ContextBase.php(143): SP\Core\Context\ContextBase->checkContext()
#1 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(100): SP\Core\Context\ContextBase->getContextKey(String,NULL)
#2 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(392): SP\Core\Context\SessionContext->getContextKey(String)
#3 /var/www/html/syspass/lib/SP/Core/Language.php(211): SP\Core\Context\SessionContext->getLocale()
#4 /var/www/html/syspass/lib/SP/Providers/Log/LoggerBase.php(78): SP\Core\Language->setAppLocales()
#5 /var/www/html/syspass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Log\LoggerBase->updateEvent(String,Object(SP\Core\Events\Event))
#6 /var/www/html/syspass/lib/SP/Services/Upgrade/UpgradeConfigService.php(224): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#7 /var/www/html/syspass/lib/SP/Bootstrap.php(423): SP\Services\Upgrade\UpgradeConfigService->upgrade(String,Object(SP\Config\ConfigData))
#8 /var/www/html/syspass/lib/SP/Bootstrap.php(397): SP\Bootstrap->checkConfigVersion()
#9 /var/www/html/syspass/lib/SP/Bootstrap.php(300): SP\Bootstrap->initConfig()
#10 /var/www/html/syspass/lib/SP/Bootstrap.php(227): SP\Bootstrap->initializeCommon()
#11 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#12 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(879): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#13 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#14 /var/www/html/syspass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#15 /var/www/html/syspass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#16 /var/www/html/syspass/index.php(28): require(String)","caller":"N/A"}
[2021-10-19 12:17:18] syspass.EXCEPTION: logger {"message":"Contexto no inicializado
#0 /var/www/html/syspass/lib/SP/Core/Context/ContextBase.php(143): SP\Core\Context\ContextBase->checkContext()
#1 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(100): SP\Core\Context\ContextBase->getContextKey(String,Object(SP\Services\User\UserLoginResponse))
#2 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(232): SP\Core\Context\SessionContext->getContextKey(String,Object(SP\Services\User\UserLoginResponse))
#3 /var/www/html/syspass/lib/SP/Providers/Log/LoggerBase.php(80): SP\Core\Context\SessionContext->getUserData()
#4 /var/www/html/syspass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Log\LoggerBase->updateEvent(String,Object(SP\Core\Events\Event))
#5 /var/www/html/syspass/lib/SP/Services/Upgrade/UpgradeConfigService.php(224): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#6 /var/www/html/syspass/lib/SP/Bootstrap.php(423): SP\Services\Upgrade\UpgradeConfigService->upgrade(String,Object(SP\Config\ConfigData))
#7 /var/www/html/syspass/lib/SP/Bootstrap.php(397): SP\Bootstrap->checkConfigVersion()
#8 /var/www/html/syspass/lib/SP/Bootstrap.php(300): SP\Bootstrap->initConfig()
#9 /var/www/html/syspass/lib/SP/Bootstrap.php(227): SP\Bootstrap->initializeCommon()
#10 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#11 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(879): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#12 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#13 /var/www/html/syspass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#14 /var/www/html/syspass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#15 /var/www/html/syspass/index.php(28): require(String)","caller":"N/A"}

[2021-10-19 12:17:18] syspass.DEBUG: upgrade.config.end {"message":"Actualizar Configuración","user":"N/A","address":"192.168.56.107","caller":"SP\Services\Upgrade\UpgradeConfigService::upgrade"} []

[2021-10-19 12:17:18] syspass.EXCEPTION: logger {"message":"Contexto no inicializado
#0 /var/www/html/syspass/lib/SP/Core/Context/ContextBase.php(143): SP\Core\Context\ContextBase->checkContext()
#1 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(100): SP\Core\Context\ContextBase->getContextKey(String,NULL)
#2 /var/www/html/syspass/lib/SP/Core/Context/SessionContext.php(392): SP\Core\Context\SessionContext->getContextKey(String)
#3 /var/www/html/syspass/lib/SP/Core/Language.php(224): SP\Core\Context\SessionContext->getLocale()
#4 /var/www/html/syspass/lib/SP/Providers/Log/LoggerBase.php(104): SP\Core\Language->unsetAppLocales()
#5 /var/www/html/syspass/lib/SP/Core/Events/EventDispatcherBase.php(121): SP\Providers\Log\LoggerBase->updateEvent(String,Object(SP\Core\Events\Event))
#6 /var/www/html/syspass/lib/SP/Services/Upgrade/UpgradeConfigService.php(224): SP\Core\Events\EventDispatcherBase->notifyEvent(String,Object(SP\Core\Events\Event))
#7 /var/www/html/syspass/lib/SP/Bootstrap.php(423): SP\Services\Upgrade\UpgradeConfigService->upgrade(String,Object(SP\Config\ConfigData))
#8 /var/www/html/syspass/lib/SP/Bootstrap.php(397): SP\Bootstrap->checkConfigVersion()
#9 /var/www/html/syspass/lib/SP/Bootstrap.php(300): SP\Bootstrap->initConfig()
#10 /var/www/html/syspass/lib/SP/Bootstrap.php(227): SP\Bootstrap->initializeCommon()
#11 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#12 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(879): call_user_func(Object(Closure),Object(Klein\Request),Object(Klein\Response),Object(Klein\ServiceProvider),Object(Klein\App),Object(Klein\Klein),Object(Klein\DataCollection\RouteCollection),Array)
#13 /var/www/html/syspass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route),Object(Klein\DataCollection\RouteCollection),Array)
#14 /var/www/html/syspass/lib/SP/Bootstrap.php(464): Klein\Klein->dispatch(Object(Klein\Request))
#15 /var/www/html/syspass/lib/Base.php(75): SP\Bootstrap->run(Object(DI\Container))
#16 /var/www/html/syspass/index.php(28): require(String)","caller":"N/A"}
[2021-10-19 12:17:18] syspass.ERROR: logger {"message":"Could not set locale","caller":"SP\Core\Language::setLocales"}
[2021-10-19 12:17:18] syspass.INFO: logger {"message":"Loaded icons cache","caller":"SP\Core\UI\Theme::initIcons"}
[2021-10-19 12:17:18] syspass.INFO: logger {"message":"Loaded actions cache","caller":"SP\Core\Acl\Actions::loadCache"}

Screenshots
If applicable, add screenshots to help explain your problem.

Platform (please complete the following information):

  • OS: RHEL
  • OS 8
  • Browser [e.g. Firefox, Chrome]

Additional context
Add any other context about the problem here.

@supkk
Copy link
Author

supkk commented Oct 28, 2021

El body de la petiición estaba mal formado, '{ "jsonrpc": "2.0", "method": "account/search", "params": { "authToken": "XXXXXXXX" }, "id": "1" }'
el campo "id" es entero y va sin comillas

'{ "jsonrpc": "2.0", "method": "account/search", "params": { "authToken": "XXXXXXXX" }, "id": 1 }'

@supkk supkk closed this as completed Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant