superdesk / web-publisher

Superdesk Publisher - the next generation publishing platform for journalists and newsrooms.
GNU Affero General Public License v3.0
96 stars 55 forks source link

Never ending loading screen for Publisher Settings in Superdesk #1002

Closed mikeavena closed 4 years ago

mikeavena commented 4 years ago

After linking Superdesk and Superdesk Publisher, navigating to the Publisher Settings tab in Superdesk gives a never-ending loading screen and prints the following error to the console:

Possibly unhandled rejection: {"data":{"code":500,"message":"Argument 1 passed to SWP\\Bundle\\CoreBundle\\Context\\CachedTenantContext::getCacheKey() must be of the type string, null given, called in /var/www/publisher/src/SWP/Bundle/CoreBundle/Context/CachedTenantContext.php on line 54"},"status":500,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"http://example.com/api/v2/tenants/","params":{"limit":1000,"sorting[name]":"asc","withRoutes":true},"headers":{"Authorization":"Basic redacted key","Accept":"application/json, text/plain, */*"}},"statusText":"Internal Server Error","xhrStatus":"complete"}

I have the following values in my Publisher .env:

SUPERDESK_SERVERS='["superdesk.example.com"]' CORS_ALLOW_ORIGIN=*

mikeavena commented 4 years ago

I found the problem. Because I had populated the database with test data during the install process using the method from the install guide, there were tenants that had a domain_name = null. When Superdesk tried to hit the /api/v2/tenants endpoint, getCacheKey() in /src/SWP/Bundle/CoreBundle/Context/CachedTenantContext.php threw an error because $host was null. Removing the tenants with no domain fixed the issue.

ahilles107 commented 4 years ago

Hey, great that You found that problem. Can You describe me how you was able to add tenant without domain? We will then fix that ;)