I just migrated a SS4 site to a new server. Now, when I try to upload an image, I get the message below. Here is one of the errors I’ve been seeing:
>
>
> Server responded with an error. Authentication required
>
> Unexpected token > in JSON at position
This is happening even though I have just authenticated as an Admin. I thought it was a permissions problem on the file system, but after looking further into it, that doesn’t seem to be the case.
The files do seem to upload, but the preview is not created and does not appear in the preview area. I can save the asset, but not with the “save” and “publish” buttons in the bottom right, I have to use the bulk actions to publish the files. Once I do this, the preview appears.
I’m receiving / have received these error in the console:
Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
(async)http://example.com/admin/assets/show/295/edit/307 400 (Bad Request)
GET http://example.com/admin/assets/show/295/edit/307 400 (Bad Request)
I’m also receiving an error message in the CMS, above the preview, that reads, “Your session has expired. Please re-submit the form.”
You might be able to see more about this error in the Network tab of your browser’s dev tools, by looking at the full response of those requests that gave a 400 response. The Unexpected token &lt; in JSON at position 0 part implies that a html response was received when a JSON one was expected, so there might be a detailed error message there.
vendor.js?m=1530220188:1 Warning - the `printer` exports from `graphql-tag` will be removed in the next major version.
See https://github.com/apollographql/graphql-tag/issues/54 for more information.
Hi @mckinselberg, the Console is just one part of the Dev tools in your browser and doesn’t give you a lot of information about http requests. If you click the Network tab you can get more information on the response from the server.
@jonom, i don’t see anything unusual in the network tab, though I’m not entirely sure what to look for.
To me, what seems to be happening is that in the middle of the upload, my session is being terminated. Not each time, but most times, the CMS logs me out and asks me to reauthenticate if I want to work with the just-uploaded files.