Unsupported scope was requested. Enterprise Search integration with Box using OAuth 2

I am trying to connect a Box application as a Source in Workplace Search. The Box application is using OAuth 2.0 by following the documentation link: Connecting Box | Workplace Search Guide [8.3] | Elastic
The redirect uri in the Box App us defined as https://<Kibana_base_url>/app/enterprise_search/workplace_search/sources/added
When I try to connect to the source from Workplace search, we are getting Unsupported scope was requested error in the Workplace search dashboard (attached screenshot).
I added the source as Box and gave the client_id and secret.
Logged into Workplace search as elastic super user (also tried with elastic_search user).
Please help me with this error.

Hi @rajkeshav ,

This probably means that Enterprise Search sent a request for a set of scopes that the configured OAuth2 app did not have configured. From the Box documentation, see:

Within Application Scopes, ensure the following scopes are selected:

Read all files and folders stored in Box
Read and write all files and folders stored in Box
Manage enterprise properties

Can you confirm that these are set correctly in your Box OAuth2 app? Can you confirm that Workplace Search has been configured to connect with the matching Client Id and Client Secret for the OAuth2 app that you verified?

Hi Sean,
We did ensure that the client_id and secret are correct and also the settings for read/write, manage enterprise properties were checked. We still get the error.

Best regards,
Rajesh

Hi @rajkeshav

I just double checked locally, and cannot reproduce (which probably rules out Box having changed their scopes out from under us).

Can you share your Enterprise Search logs from when you tried to connect and failed? Specifically, I'd want to see any stack traces, 400 errors, or 500 errors in that time frame.

If you're willing, can you also share a screen shot of the scopes that you have granted to your Box OAuth2 app?

Hi Sean.
I can see 500 internal error in the logs. Please let me know if anything interests you and if you need more logs. I am also sharing the box app config.

[2022-07-07T16:47:07.099+00:00][29200][5040][action_controller][INFO]: Processing by ErrorsController#internal_error as JSON
[2022-07-07T16:47:07.100+00:00][29200][5040][action_controller][INFO]: Parameters: {"code"=>"[FILTERED]", "state"=>"{"action":"create","context":"organization","service_type":"box","csrf_token":"Q0NkU3pGb2NLT0Q2M3ZTa0VDejJHeGdHMHhpYjZwOVNwRkVVa1VQOEtMeDFidnVtQWJDcEVDSFNCU05vOFowSk5SYkJ6MnVUdFdQa2VqNzhHemgyZ2c9PQ==","index_permissions":false}", "token_package"=>"VmxsR1dIZHdTWGR3U21vdlJYY3hhbmRLTUROblpFcE9TVUpJVGtwdllVNWhURE4yVlVka1FYa3JiR1JDSzNseE16UlJSblphWkdjNVJWZGpTek5NZWxOa1RFTTBkMmwzYzAwMkszWlpjelJ2YUhORGRsSkZPQ3Q0TkRGaFdtNUhTbmMwWW5GdVlsQmlhMFpZZW05RFl6RnhiRnB3TlUxdE5IcGpOa1kwUVU5YVdUa3ZXVVYzVEcxQlZtSnhhMGxNTm1abWVHUmtXVGRRVkZOTE1XaGpTMGQ0VG5WamFtWkhOVVUxV1VsVVMybHNOemw1UjIxM1RrRlpVVUlyUlRGdkxTMTBjWGxMYzBkb2NYZHlkR3MwYUhwb2JrOW5NREIzUFQwPS0tYzliMjdmZDRjODFlNmY5NjUwNWJlNjVmZWU2NDdlOTVmZGUxOWI5OQ"}
[2022-07-07T16:47:07.101+00:00][29200][5040][app-server][ERROR]: [5c255cec-8f59-4b90-bd9d-d57454bb9fd5] Internal server error. Please check your application server logs for more details and contact Elastic support if the problem persists
[2022-07-07T16:47:07.104+00:00][29200][5040][action_controller][INFO]: Completed 500 Internal Server Error in 4ms (Views: 0.9ms)
127.0.0.1 - - [07/Jul/2022:16:47:06 +0000] "GET /ws/sources/create?code=ylZf8kGq42Df033ybERG1kxUsMxmhcb6&state=%7B%22action%22%3A%22create%22%2C%22context%22%3A%22organization%22%2C%22service_type%22%3A%22box%22%2C%22csrf_token%22%3A%22Q0NkU3pGb2NLT0Q2M3ZTa0VDejJHeGdHMHhpYjZwOVNwRkVVa1VQOEtMeDFidnVtQWJDcEVDSFNCU05vOFowSk5SYkJ6MnVUdFdQa2VqNzhHemgyZ2c9PQ%3D%3D%22%2C%22index_permissions%22%3Afalse%7D&token_package=VmxsR1dIZHdTWGR3U21vdlJYY3hhbmRLTUROblpFcE9TVUpJVGtwdllVNWhURE4yVlVka1FYa3JiR1JDSzNseE16UlJSblphWkdjNVJWZGpTek5NZWxOa1RFTTBkMmwzYzAwMkszWlpjelJ2YUhORGRsSkZPQ3Q0TkRGaFdtNUhTbmMwWW5GdVlsQmlhMFpZZW05RFl6RnhiRnB3TlUxdE5IcGpOa1kwUVU5YVdUa3ZXVVYzVEcxQlZtSnhhMGxNTm1abWVHUmtXVGRRVkZOTE1XaGpTMGQ0VG5WamFtWkhOVVUxV1VsVVMybHNOemw1UjIxM1RrRlpVVUlyUlRGdkxTMTBjWGxMYzBkb2NYZHlkR3MwYUhwb2JrOW5NREIzUFQwPS0tYzliMjdmZDRjODFlNmY5NjUwNWJlNjVmZWU2NDdlOTVmZGUxOWI5OQ HTTP/1.1" 500 145 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2022-07-07T16:47:07.333+00:00][29200][5040][app-server][INFO]: [f92e7ec2-6de9-4568-b260-68a44f132fc7] Started GET "/ws/org/sources" for 127.0.0.1 at 2022-07-07 16:47:07 +0000
[2022-07-07T16:47:07.340+00:00][29200][5040][action_controller][INFO]: Processing by FritoPie::ContentSourcesController#index as JSON
[2022-07-07T16:47:07.340+00:00][29200][5040][action_controller][INFO]: Parameters: {"context"=>:organization}
[2022-07-07T16:47:07.631+00:00][29200][5040][action_controller][INFO]: Completed 200 OK in 290ms (Views: 1.3ms)
127.0.0.1 - - [07/Jul/2022:16:47:07 +0000] "GET /ws/org/sources HTTP/1.1" 200 443 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2022-07-07T16:47:07.968+00:00][29200][5016][app-server][INFO]: [5fdf3c5f-02c9-44e6-8bd4-e94fbe85a8b9] Started GET "/ws/org/sources" for 127.0.0.1 at 2022-07-07 16:47:07 +0000
[2022-07-07T16:47:07.975+00:00][29200][5016][action_controller][INFO]: Processing by FritoPie::ContentSourcesController#index as JSON
[2022-07-07T16:47:07.975+00:00][29200][5016][action_controller][INFO]: Parameters: {"context"=>:organization}
[2022-07-07T16:47:07.992+00:00][29200][5204][app-server][INFO]: [7a4d5ca9-2d42-41f9-819e-e14ddac6ca2c] Started GET "/ws/org/sources/status" for 127.0.0.1 at 2022-07-07 16:47:07 +0000
[2022-07-07T16:47:07.997+00:00][29200][5204][action_controller][INFO]: Processing by FritoPie::ContentSourcesController#status as JSON
[2022-07-07T16:47:07.998+00:00][29200][5204][action_controller][INFO]: Parameters: {"context"=>:organization}
[2022-07-07T16:47:08.090+00:00][29200][5204][action_controller][INFO]: Completed 200 OK in 92ms (Views: 0.8ms)
127.0.0.1 - - [07/Jul/2022:16:47:07 +0000] "GET /ws/org/sources/status HTTP/1.1" 200 2 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2022-07-07T16:47:08.234+00:00][29200][5016][action_controller][INFO]: Completed 200 OK in 258ms (Views: 0.9ms)
127.0.0.1 - - [07/Jul/2022:16:47:07 +0000] "GET /ws/org/sources HTTP/1.1" 200 443 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2022-07-07T16:47:18.432+00:00][29200][5028][app-server][INFO]: [223d8c6d-4e5e-4962-946a-992af7f0db1e] Started GET "/ws/org/sources/status" for 127.0.0.1 at 2022-07-07 16:47:18 +0000
[2022-07-07T16:47:18.442+00:00][29200][5028][action_controller][INFO]: Processing by FritoPie::ContentSourcesController#status as JSON
[2022-07-07T16:47:18.443+00:00][29200][5028][action_controller][INFO]: Parameters: {"context"=>:organization}
[2022-07-07T16:47:18.601+00:00][29200][5028][action_controller][INFO]: Completed 200 OK in 157ms (Views: 0.8ms)
127.0.0.1 - - [07/Jul/2022:16:47:18 +0000] "GET /ws/org/sources/status HTTP/1.1" 200 2 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2022-07-07T16:47:23.520+00:00][29200][5204][app-server][INFO]: [e506c6bf-11ef-43d9-bef0-0690b784cbdb] Started GET "/ws/org/settings/connectors/box" for 127.0.0.1 at 2022-07-07 16:47:23 +0000
[2022-07-07T16:47:23.529+00:00][29200][5204][action_controller][INFO]: Processing by FritoPie::Organizations::ContentSourceOauthConfigurationsController#show as JSON
[2022-07-07T16:47:23.529+00:00][29200][5204][action_controller][INFO]: Parameters: {"context"=>:organization, "service_type"=>"box"}
[2022-07-07T16:47:23.687+00:00][29200][5204][action_controller][INFO]: Completed 200 OK in 156ms (Views: 1.1ms)
127.0.0.1 - - [07/Jul/2022:16:47:23 +0000] "GET /ws/org/settings/connectors/box HTTP/1.1" 200 262 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2022-07-07T16:47:25.350+00:00][29200][5016][app-server][INFO]: [4de31708-e73a-447c-bab2-19b836256b80] Started GET "/ws/org/sources/box/prepare?index_permissions=false" for 127.0.0.1 at 2022-07-07 16:47:25 +0000
[2022-07-07T16:47:25.357+00:00][29200][5016][action_controller][INFO]: Processing by FritoPie::ContentSourcesController#prepare as JSON
[2022-07-07T16:47:25.357+00:00][29200][5016][action_controller][INFO]: Parameters: {"index_permissions"=>"false", "context"=>:organization, "service_type"=>"box"}
[2022-07-07T16:47:25.547+00:00][29200][5016][action_controller][INFO]: Completed 200 OK in 189ms (Views: 0.8ms)
127.0.0.1 - - [07/Jul/2022:16:47:25 +0000] "GET /ws/org/sources/box/prepare?index_permissions=false HTTP/1.1" 200 821 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2022-07-07T16:47:35.283+00:00][29200][5016][app-server][INFO]: [82b56893-6433-4d4b-92f4-d1fa89a88759] Started GET "/api/ent/v2/internal/client_config" for 127.0.0.1 at 2022-07-07 16:47:35 +0000
[2022-07-07T16:47:35.289+00:00][29200][5016][action_controller][INFO]: Processing by Api::SharedTogo::V2::Internal::ClientConfigController#show as /
[2022-07-07T16:47:35.502+00:00][29200][5016][action_controller][INFO]: Completed 200 OK in 212ms (Views: 1.3ms)
127.0.0.1 - - [07/Jul/2022:16:47:35 +0000] "GET /api/ent/v2/internal/client_config HTTP/1.1" 200 984 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2022-07-07T16:47:35.899+00:00][29200][5204][app-server][INFO]: [069f7a3f-b6a7-44d5-96d4-100d30b14f6b] Started GET "/ws/sources/create?code=[FILTERED]&state=%7B%22action%22%3A%22create%22%2C%22context%22%3A%22organization%22%2C%22service_type%22%3A%22box%22%2C%22csrf_token%22%3A%22NTRpUGpNcy9KTXF6empkQTA3YlFQTzI3aktHQVc5VnNBb3RWcFI0SjhnRnpCdGlmQmhWNnd3U2lKSHZ3c0k3eVdMcVlrR2hnOGVoSWJFWDBPa2xvT2c9PQ%3D%3D%22%2C%22index_permissions%22%3Afalse%7D&token_package=VlVSWmMyWktlamN3U3pZdlVYZENjVW96WkVaSWFFNVNOR1J3WTJSeFNVRlFkVlpSUkROTlJWaFpNakp1WWtwWlIzWTFTMmhEVTFCVFExbzJMMk5CVjB0RVp6UmFLMGMyWVZsTFJYUTRRMmN6TDFRdmVsRkNjMlkzTDJoWVVHazJVbEJsYlZrMU9IbzJjVXRsWm1kSWVFWlhNakU0TW5ZMk55OUdWMmhwWlhWT1ZHMURkRU5yVW5SbVNFdGpjWGhJY1M5a1MxcFdUamxrYmxjeE9HWXZWR0ZxVlRWamFsVlRSMEZZUlV4MWEyTmphbnBDWmpVelVsUkdObTlwUmpOWExTMWtUbTF5V1ZnelZuTnFRa1JUU25SYVkwazJRazlSUFQwPS0tYzZlYTRmMDQ1NjQ2ZTI0MTNmOWFlMTczODFiYzMwMmQzNWMxNmJlNQ" for 127.0.0.1 at 2022-07-07 16:47:35 +0000
[2022-07-07T16:47:35.905+00:00][29200][5204][action_controller][INFO]: Processing by FritoPie::ContentSourcesController#create_or_update as JSON
[2022-07-07T16:47:35.905+00:00][29200][5204][action_controller][INFO]: Parameters: {"code"=>"[FILTERED]", "state"=>"{"action":"create","context":"organization","service_type":"box","csrf_token":"NTRpUGpNcy9KTXF6empkQTA3YlFQTzI3aktHQVc5VnNBb3RWcFI0SjhnRnpCdGlmQmhWNnd3U2lKSHZ3c0k3eVdMcVlrR2hnOGVoSWJFWDBPa2xvT2c9PQ==","index_permissions":false}", "token_package"=>"VlVSWmMyWktlamN3U3pZdlVYZENjVW96WkVaSWFFNVNOR1J3WTJSeFNVRlFkVlpSUkROTlJWaFpNakp1WWtwWlIzWTFTMmhEVTFCVFExbzJMMk5CVjB0RVp6UmFLMGMyWVZsTFJYUTRRMmN6TDFRdmVsRkNjMlkzTDJoWVVHazJVbEJsYlZrMU9IbzJjVXRsWm1kSWVFWlhNakU0TW5ZMk55OUdWMmhwWlhWT1ZHMURkRU5yVW5SbVNFdGpjWGhJY1M5a1MxcFdUamxrYmxjeE9HWXZWR0ZxVlRWamFsVlRSMEZZUlV4MWEyTmphbnBDWmpVelVsUkdObTlwUmpOWExTMWtUbTF5V1ZnelZuTnFRa1JUU25SYVkwazJRazlSUFQwPS0tYzZlYTRmMDQ1NjQ2ZTI0MTNmOWFlMTczODFiYzMwMmQzNWMxNmJlNQ"}
[2022-07-07T16:47:36.280+00:00][29200][5204][action_controller][INFO]: Completed 500 Internal Server Error in 374ms
[2022-07-07T16:47:36.283+00:00][29200][5204][app-server][ERROR]: [069f7a3f-b6a7-44d5-96d4-100d30b14f6b] Exception: ArgumentError: Invalid content type 'text/html'
/usr/share/enterprise-search/lib/war/gems/gems/signet-0.14.0/lib/signet/oauth_2.rb:83:in parse_credentials': Invalid content type 'text/html' (ArgumentError) from /usr/share/enterprise-search/lib/war/gems/gems/signet-0.14.0/lib/signet/oauth_2/client.rb:1034:in fetch_access_token'
from /usr/share/enterprise-search/lib/war/frito_pie/lib/frito_pie/content_source_service/box.class:107:in create!' from /usr/share/enterprise-search/lib/war/frito_pie/lib/frito_pie/content_source_service.class:174:in create!'
from /usr/share/enterprise-search/lib/war/frito_pie/app/controllers/frito_pie/content_sources_controller.class:464:in handle_create_content_source!' from /usr/share/enterprise-search/lib/war/frito_pie/app/controllers/frito_pie/content_sources_controller.class:124:in create_or_update'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_controller/metal/basic_implicit_render.rb:6:in send_action' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/abstract_controller/base.rb:194:in process_action'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_controller/metal/rendering.rb:30:in process_action' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/abstract_controller/callbacks.rb:42:in block in process_action'
from /usr/share/enterprise-search/lib/war/gems/gems/activesupport-5.2.7/lib/active_support/callbacks.rb:109:in block in run_callbacks' from /usr/share/enterprise-search/lib/war/app/controllers/concerns/request_audit_logger_concern.class:36:in audit_request'
from /usr/share/enterprise-search/lib/war/gems/gems/activesupport-5.2.7/lib/active_support/callbacks.rb:118:in block in run_callbacks' from /usr/share/enterprise-search/lib/war/app/controllers/concerns/request_audit_logger_concern.class:22:in audit_request_authentication'
from /usr/share/enterprise-search/lib/war/gems/gems/activesupport-5.2.7/lib/active_support/callbacks.rb:118:in block in run_callbacks' from /usr/share/enterprise-search/lib/war/gems/gems/activesupport-5.2.7/lib/active_support/callbacks.rb:136:in run_callbacks'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/abstract_controller/callbacks.rb:41:in process_action' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_controller/metal/rescue.rb:22:in process_action'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_controller/metal/instrumentation.rb:34:in block in process_action' from /usr/share/enterprise-search/lib/war/gems/gems/activesupport-5.2.7/lib/active_support/notifications.rb:168:in block in instrument'
from /usr/share/enterprise-search/lib/war/gems/gems/activesupport-5.2.7/lib/active_support/notifications/instrumenter.rb:23:in instrument' from /usr/share/enterprise-search/lib/war/gems/gems/activesupport-5.2.7/lib/active_support/notifications.rb:168:in instrument'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_controller/metal/instrumentation.rb:32:in process_action' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_controller/metal/params_wrapper.rb:256:in process_action'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/abstract_controller/base.rb:134:in process' from /usr/share/enterprise-search/lib/war/gems/gems/actionview-5.2.7/lib/action_view/rendering.rb:32:in process'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_controller/metal.rb:191:in dispatch' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_controller/metal.rb:252:in dispatch'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/routing/route_set.rb:52:in dispatch' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/routing/route_set.rb:34:in serve'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/journey/router.rb:52:in block in serve' from org/jruby/RubyArray.java:1865:in each'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/journey/router.rb:35:in serve' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/routing/route_set.rb:840:in call'
from /usr/share/enterprise-search/lib/war/gems/gems/rack-attack-6.6.0/lib/rack/attack.rb:103:in call' from /usr/share/enterprise-search/lib/war/lib/middleware/rewrite_deprecated_routes_middleware.class:24:in call'
from /usr/share/enterprise-search/lib/war/lib/middleware/system_logging_middleware.class:37:in call' from /usr/share/enterprise-search/lib/war/gems/gems/rack-attack-6.6.0/lib/rack/attack.rb:127:in call'
from /usr/share/enterprise-search/lib/war/lib/middleware/eweb_access_middleware.class:15:in call' from /usr/share/enterprise-search/lib/war/gems/gems/warden-1.2.7/lib/warden/manager.rb:36:in block in call'
from org/jruby/RubyKernel.java:1237:in catch' from /usr/share/enterprise-search/lib/war/gems/gems/warden-1.2.7/lib/warden/manager.rb:35:in call'
from /usr/share/enterprise-search/lib/war/gems/gems/rack-cors-1.0.6/lib/rack/cors.rb:98:in call' from /usr/share/enterprise-search/lib/war/gems/gems/rack-2.1.4.1/lib/rack/tempfile_reaper.rb:17:in call'
from /usr/share/enterprise-search/lib/war/gems/gems/rack-2.1.4.1/lib/rack/etag.rb:27:in call' from /usr/share/enterprise-search/lib/war/gems/gems/rack-2.1.4.1/lib/rack/conditional_get.rb:27:in call'
from /usr/share/enterprise-search/lib/war/gems/gems/rack-2.1.4.1/lib/rack/head.rb:14:in call' from /usr/share/enterprise-search/lib/war/lib/middleware/content_type_middleware.class:21:in call'
from /usr/share/enterprise-search/lib/war/lib/middleware/content_security_policy_middleware.class:13:in call' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/http/content_security_policy.rb:18:in call'
from /usr/share/enterprise-search/lib/war/gems/gems/rack-2.1.4.1/lib/rack/session/abstract/id.rb:269:in context' from /usr/share/enterprise-search/lib/war/gems/gems/rack-2.1.4.1/lib/rack/session/abstract/id.rb:263:in call'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/middleware/cookies.rb:670:in call' from /usr/share/enterprise-search/lib/war/gems/gems/rack-ssl-enforcer-0.2.5/lib/rack/ssl-enforcer.rb:44:in call'
from /usr/share/enterprise-search/lib/war/lib/middleware/cookie_strip_middleware.class:12:in call' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/middleware/callbacks.rb:28:in block in call'
from /usr/share/enterprise-search/lib/war/gems/gems/activesupport-5.2.7/lib/active_support/callbacks.rb:98:in run_callbacks' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/middleware/callbacks.rb:26:in call'
from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/middleware/debug_exceptions.rb:61:in call' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/middleware/show_exceptions.rb:33:in call'
from /usr/share/enterprise-search/lib/war/gems/gems/railties-5.2.7/lib/rails/rack/logger.rb:38:in call_app' from /usr/share/enterprise-search/lib/war/gems/gems/railties-5.2.7/lib/rails/rack/logger.rb:26:in block in call'
from /usr/share/enterprise-search/lib/war/gems/gems/activesupport-5.2.7/lib/active_support/tagged_logging.rb:71:in block in tagged' from /usr/share/enterprise-search/lib/war/gems/gems/activesupport-5.2.7/lib/active_support/tagged_logging.rb:28:in tagged'
from /usr/share/enterprise-search/lib/war/gems/gems/activesupport-5.2.7/lib/active_support/tagged_logging.rb:71:in tagged' from /usr/share/enterprise-search/lib/war/gems/gems/railties-5.2.7/lib/rails/rack/logger.rb:26:in call'
from /usr/share/enterprise-search/lib/war/lib/middleware/silencer_middleware.class:9:in call' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/middleware/remote_ip.rb:81:in call'
from /usr/share/enterprise-search/lib/war/lib/middleware/request_id_middleware.class:11:in call' from /usr/share/enterprise-search/lib/war/gems/gems/rack-2.1.4.1/lib/rack/method_override.rb:24:in call'
from /usr/share/enterprise-search/lib/war/gems/gems/rack-2.1.4.1/lib/rack/runtime.rb:24:in call' from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-5.2.7/lib/action_dispatch/middleware/executor.rb:14:in call'
from /usr/share/enterprise-search/lib/war/gems/gems/rack-2.1.4.1/lib/rack/sendfile.rb:113:in call' from /usr/share/enterprise-search/lib/war/lib/middleware/stats_middleware.class:10:in call'
from /usr/share/enterprise-search/lib/war/lib/middleware/external_host_middleware.class:26:in call' from /usr/share/enterprise-search/lib/war/gems/gems/railties-5.2.7/lib/rails/engine.rb:524:in call'
from /usr/share/enterprise-search/lib/war/vendor/fishwife-servlet/lib/fishwife/rack_servlet.rb:74:in `service'

[2022-07-07T16:47:36.287+00:00][29200][5204][action_controller][INFO]: Processing by ErrorsController#internal_error as JSON
[2022-07-07T16:47:36.287+00:00][29200][5204][action_controller][INFO]: Parameters: {"code"=>"[FILTERED]", "state"=>"{"action":"create","context":"organization","service_type":"box","csrf_token":"NTRpUGpNcy9KTXF6empkQTA3YlFQTzI3aktHQVc5VnNBb3RWcFI0SjhnRnpCdGlmQmhWNnd3U2lKSHZ3c0k3eVdMcVlrR2hnOGVoSWJFWDBPa2xvT2c9PQ==","index_permissions":false}", "token_package"=>"VlVSWmMyWktlamN3U3pZdlVYZENjVW96WkVaSWFFNVNOR1J3WTJSeFNVRlFkVlpSUkROTlJWaFpNakp1WWtwWlIzWTFTMmhEVTFCVFExbzJMMk5CVjB0RVp6UmFLMGMyWVZsTFJYUTRRMmN6TDFRdmVsRkNjMlkzTDJoWVVHazJVbEJsYlZrMU9IbzJjVXRsWm1kSWVFWlhNakU0TW5ZMk55OUdWMmhwWlhWT1ZHMURkRU5yVW5SbVNFdGpjWGhJY1M5a1MxcFdUamxrYmxjeE9HWXZWR0ZxVlRWamFsVlRSMEZZUlV4MWEyTmphbnBDWmpVelVsUkdObTlwUmpOWExTMWtUbTF5V1ZnelZuTnFRa1JUU25SYVkwazJRazlSUFQwPS0tYzZlYTRmMDQ1NjQ2ZTI0MTNmOWFlMTczODFiYzMwMmQzNWMxNmJlNQ"}
[2022-07-07T16:47:36.288+00:00][29200][5204][app-server][ERROR]: [069f7a3f-b6a7-44d5-96d4-100d30b14f6b] Internal server error. Please check your application server logs for more details and contact Elastic support if the problem persists
[2022-07-07T16:47:36.293+00:00][29200][5204][action_controller][INFO]: Completed 500 Internal Server Error in 5ms (Views: 0.7ms)
127.0.0.1 - - [07/Jul/2022:16:47:35 +0000] "GET /ws/sources/create?code=9zTDR2F9BKwgycZxLHfIyVFoiWpDekQb&state=%7B%22action%22%3A%22create%22%2C%22context%22%3A%22organization%22%2C%22service_type%22%3A%22box%22%2C%22csrf_token%22%3A%22NTRpUGpNcy9KTXF6empkQTA3YlFQTzI3aktHQVc5VnNBb3RWcFI0SjhnRnpCdGlmQmhWNnd3U2lKSHZ3c0k3eVdMcVlrR2hnOGVoSWJFWDBPa2xvT2c9PQ%3D%3D%22%2C%22index_permissions%22%3Afalse%7D&token_package=VlVSWmMyWktlamN3U3pZdlVYZENjVW96WkVaSWFFNVNOR1J3WTJSeFNVRlFkVlpSUkROTlJWaFpNakp1WWtwWlIzWTFTMmhEVTFCVFExbzJMMk5CVjB0RVp6UmFLMGMyWVZsTFJYUTRRMmN6TDFRdmVsRkNjMlkzTDJoWVVHazJVbEJsYlZrMU9IbzJjVXRsWm1kSWVFWlhNakU0TW5ZMk55OUdWMmhwWlhWT1ZHMURkRU5yVW5SbVNFdGpjWGhJY1M5a1MxcFdUamxrYmxjeE9HWXZWR0ZxVlRWamFsVlRSMEZZUlV4MWEyTmphbnBDWmpVelVsUkdObTlwUmpOWExTMWtUbTF5V1ZnelZuTnFRa1JUU25SYVkwazJRazlSUFQwPS0tYzZlYTRmMDQ1NjQ2ZTI0MTNmOWFlMTczODFiYzMwMmQzNWMxNmJlNQ HTTP/1.1" 500 145 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2022-07-07T16:47:36.503+00:00][29200][5040][app-server][INFO]: [a3b5b96c-ffd7-4424-a16e-c71f7e1126e7] Started GET "/ws/org/sources" for 127.0.0.1 at 2022-07-07 16:47:36 +0000
[2022-07-07T16:47:36.510+00:00][29200][5040][action_controller][INFO]: Processing by FritoPie::ContentSourcesController#index as JSON
[2022-07-07T16:47:36.510+00:00][29200][5040][action_controller][INFO]: Parameters: {"context"=>:organization}
[2022-07-07T16:47:36.789+00:00][29200][5040][action_controller][INFO]: Completed 200 OK in 278ms (Views: 0.7ms)
127.0.0.1 - - [07/Jul/2022:16:47:36 +0000] "GET /ws/org/sources HTTP/1.1" 200 443 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
[2022-07-07T16:47:37.117+00:00][29200][5028][app-server][INFO]: [b2cf2239-c348-4368-8bc8-1bf9e31cb49a] Started GET "/ws/org/sources" for 127.0.0.1 at 2022-07-07 16:47:37 +0000

Hi @rajkeshav

Your screenshot looks good. Just double checking - you clicked "save" before trying to connect with Workplace Search, right?

I'm able to reproduce your issue if I don't click save, or if I click save with the wrong scopes selected. But with the 3 documented scopes, I have no issue.

box_scopes

The 500 error in the logs looks relevant, sort of. Basically the response we're getting back from trying to get an access token from the OAuth2 flow is HTML (An error page) instead of JSON.

Hi Sean,
Our box admin team is reluctant to provide enterprise management permissions to the app. We are trying to get that done. I guess this topic can be closed now. Thank you very much for your detailed insight into this issue.

Best regards,
Rajesh

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.