On the same page, GET requests on load are executed normally, but a similar GET request returns a 500 error. This all works on localhost, but on the production server it throws an error
The problem here is clearly not in the external request - even when I disable it and leave simple operations with variables - the result is the same - 500 error
Have you deployed after enabling the debug mode? And make sure you turned the debug mode on the production (remote) server target instead of the local one
I’ve done it several times, but it doesn’t change anything. I have a strange problem with updating files on the server - there is a folder /app in the root - it is updated when the project is loaded, but there is also a folder /public/app - and that is what is updated. Is this a normal behaviour? - I don’t really understand the role of this folder.
Okay with that, but as far as I know, if you enable debug mode and then publish your site (uploading the config file) you should be able to see what’s the error.
If you are uploading it and you still see that you need to enable debug mode is because the config file is not properly updated.
I don’t know how to help, a 500 error could be anything.
I did a simple experiment - I made two same API Actions that consist of one command to call an external API - one on the front-end, the second on the back-end in a Server Action. And I launched it on a local server and on product hosting. On local, both methods work, but on product Server Action it does not work.
This might be the key to solving the issue. On the remote server, how is the nodejs set up? Is it pointed to /app in the root or /public/app ?
If it is pointed to /app, then there is something going on. If it is pointed to /public/app, then you might need to check your Wappler publish settings to make sure it is pointed there as well.
Sorry, I don’t quite understand where I should and what to check.
I have these settings and I’m a little confused by the fact that in the local root folder it is /public - I don’t know - is this how it should be? In any case, it is impossible to change it - the SAVE button does not respond.
When you set the nodejs up on the hosting (not in wappler), there should have been a setting to what directory is holding the files. That directory needs to match what you have in the VEF_prod - FTP - Remote Directory in wappler. Right now, from the screen shots, wappler is putting everything in the root directory.
The 500 error sounds like the files are in the wrong spot. Meaning the hosting is looking in one place and wappler put them somewhere else.
on the server, everything also goes to the root directory, and the rest of the project works fine, even on the same problematic page there are other server actions that are executed normally, the peculiarity here is that there is a call to an external API - the problem is somehow related to the operation of the API action - you don’t know which part of wappler is responsible for this?
After several days of experimentation, we managed to find a strange but working scheme. I created a website on PHP hosting and made a script on it to call an external API, that is, something like a proxy. That is, I first call the Server Action, from it a PHP script in which an external service is called, I receive a link to the generated PDF from there, and in the Server Action I download the file and send it to S3 storage. Oddly enough, this scheme works, unlike the direct one inside the Server Action.
@George I also noticed while I was looking for reasons that wappler does not update node modules on the hosting and sometimes there is simply no module for the corresponding project functions, especially for modules that are used in third-party extensions - maybe it’s worth making an option to load them when publishing?