Strapi GET request to /upload/files throws ERROR - debugging

Reacreation
I should start by explaining what I've done to trigger this error:
1. Create a new Strapi App.
2. Create a Collection-Type with a Media Field.
3. Create a new Entry from this Collection-Type with a File uploaded.
4. Delete the Media Field from the Collection-Type.
5. Finally going to the Media Library (GET request to /upload/files) will result in an ERROR.
see steps here
FIX
I did find a fix to this situation, just Add the Media field back to the Collection-Type.
If you want to remove the Media field from the collection-type, remove it manually from its Entries first and then delete the Media field.

I can confirm your issue.
Can you please open a GitHub issue there - https://github.com/strapi/strapi/issues/new/choose
If you already have a fix, can you also submit a PR to fix it.
Thank you.

Related

no permission to see this field in strapi

I am unable to enter data to fields which I have created in user collection type in strapi.
I wanted to create extra fields in user collection in strapi so I created some extra fields from builder , but when trying to enter data , the newly created fields are not editable .
You can try following ways, and check if any one of them works -
Method 1
there can always be an issue with Strapi server,
I restarted the server manually and it is fixed.
Method 2
your user might not have permission to view that field.
you can change permission of a user by -
step 1 - Login to your strapi cms with Admin account and check if you are able to edit that field(the one with no permission), if so then continue with following steps, else this method wont work for you.
setp 2 - click on settings in left panel , select the user , from the list select the user that you want to change permission with, give read write , and other permissions you want to give.
re-login with your account from which you were facing the problem, it should work now
Method 3
There might be a sync issue with your DB, sometimes your data is not synced with your DB, try deleting the field and re creating it.
I hope one of this solves your issue
After I ran into the issue multiple times myself and couldn't fix it even after re-deploying again (and again...), I found the following worked for me:
In the deployed version, go to Content-Type Builder
Select the content type that contains the field causing problems
Click the Configure the view button
Change the position of an arbitrary field
Click Save
This worked for me and also didn't require a re-deployment of my app.

Strapi endpoint for all media uploads

Does anyone know the endpoint for getting all of the iamges you uploaded to the media libray in one request?
Im using next js with strapi and need a way to grab all of the images from the media library but there doesnt seem to be any documentation on this
/api/upload
GET /api/upload/files Get a list of files
GET /api/upload/files/:id Get a specific file
POST /api/upload Upload files
DELETE /api/upload/files/:id Delete a file
Reference
https://docs.strapi.io/developer-docs/latest/plugins/upload.html#configuration
GET /upload/files
You can read more on the docs

Error getting valid response from API. Check log file for error details

I cant seem to find the error log of authorize.net api.
I have Laravel application which uses "authorizenet/authorizenet" package and the code where I try to create a customer profile, I get following error:
"Error getting valid response from API. Check log file for error details"
Can anyone tell me whereto find these logs? and what it's name?
I tried in /var/logs folder but i cant seem to find it.
if someone else has this issue, here is the solution.
The authorize.net has changed their endpoints from https://api.authorize.net to https://api2.authorize.net which is one of the possible reasons that you might get this error.
So if you are hardcoding these endpoints in your code then update it to the new one or if you are using library constant for it, same as me:
\net\authorize\api\constants\ANetEnvironment::SANDBOX
\net\authorize\api\constants\ANetEnvironment::PRODUCTION
Then simply update your library by running:
composer update authorizenet/authorizenet
This is how I resolved it and it seems to be the best way so far because it will update their library to take everything up to date if they have changes something else and you started experiencing this issue.
I hope it helps

Update deviceToken on Existing Parse iOS Installation

I'm using Parse.com REST API to suscribe users for Push Notifications.
Sometimes DeviceToken changes, so I need to Update Parse Installation Object in order to update the DeviceToken.
According to the docs, it can be accomplished by doing a PUT Request:
https://parse.com/docs/rest#installations-updating
When executing the PUT request I have the following error result:
{"code":136,"error":"deviceToken may not be changed in this operation"}
Anyone else having the same Issue?
I've had the same issue. It looks like the problem is caused by another installation object having the same deviceToken. This happened to me when I switched between developer and production APNs certificates.
To fix this, go to Parse and search Core for your deviceToken and delete it.
There was another issue I encountered where Parse did not have the deviceToken I was searching for but still would not let me update. In that case I had to delete the entire installation and re-create a new one.

openx: can't upload banner after moving to new server

I went through the whole process in order to move openx. My banners are normally displayed and I have full access to administration. The only issue is that when trying to upload a banner, it isn't saved. When returning to the banner properties tab the file is missing. Can you help please? Thanks.
This issue may raised after migrate files in to new server then you may not change "webDir" value in your configuration file under "YourOpenX/var/yourdomainame.conf.php" file .
If above mentioned not working then problem should be in "www/images" folder permission.
check and put your comment here if you need any other help.

Resources