-
Notifications
You must be signed in to change notification settings - Fork 48
CSP: Failed to save file '...' on the server #1345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sometimes even after successful CSP compile, whenever i add something like alert(1) and hit save it just starts giving errors. Super rarely can fix this by adding spaces after/before html tags. |
Looks like it doesn't check contents of the file on the server because whenever i add syntax errors etc it doesn't say anything about that. Maybe some issues with processing file locally? |
@cvertee The Language Server plays no role in the saving of documents so that log isn't going to help us. For local files, this extension determines the name of the CSP file by seeing if the file's path contains a web application name, and then saves the file on the server with the file's name begin the path starting at the web application folder name. For example, if you had file |
@isc-bsaviano thanks for the response! Not sure if i will be able to use Wireshark. Maybe will think of something for corporate computer stuff |
@cvertee You can use the web gateway's HTTP Trace facility. It doesn't require you to download any other software. The UI and functionality is rudimentary but it will get the info we need to investigate this. See the web gateway management pages docs and the HTTP Trace docs. |
@isc-bsaviano Will try to look on that (or something else) later when i'll find the time, thanks. |
Hi @cvertee, just checking in to see if the trace revealed anything. |
@isc-bsaviano Hi. Not working with IRIS for now. Tried to get to Web Gateway but probably nobody will let me get there (not the admin and whatever) so still thinking on possible workarounds |
Closing this since I can't reproduce it. @cvertee please re-open if you find reliable reproduction steps. |
Not sure if its somehow related. But whatever. I had csp file that just did not compile with vs code extension (same problem as described WITHOUT any description/details) window.onload = function() { At probably exactly 12981 or 12982 character (vs code's "selected" count when i select from this symbol to start of file) window.onload = function() {
// ----------^ here when i move = function() { at new line CSP file starts to compile When i put it back, CSP again shows compile error, moving to new line and it works again, etc Still can't say if its something problematic on the server or extension have some problems with chunk sizes??? |
@cvertee You are using client-side editing correct? csp files shouldn't be converted to base64 since they are text files. If they are, then that's a bug in this extension. Are you able to get a network trace like I mentioned above? If not, can you send me a test file I can use to reproduce this on my end? |
@isc-bsaviano Yeah i edit file from the client (i guess) side, and can't send it here. About tracing kinda trying to think of something. Not even sure it'll help because if there is an error on server compiler it should return something to display in at least the VSCode output, no? |
@cvertee Compilation errors will appear in the Output window. Errors saving a file should as well, but if VS Code doesn't get a detailed error message back from the server then it won't Output anything. I will consider adding a setting that turns on logging for REST requests. I tried to reproduce your issue again but couldn't. Without more info there's not much I can do. You can try opening an issue with the WRC. They will be able to screen share with you and their app is a secure way to share files. |
@isc-bsaviano Thanks! |
@isc-bsaviano finally sorted things out with WebGateway, i enabled HTTP tracing, saw that some csp sends /api/atelier/v3 PUT request with content NOT being base64 encrypted and this csp compiles succesfully without any troubles. But when i go to the event log i can find something interesting, the name of the csp file that can't compile, part of the content and error Another bad csp file error |
What's more interesting is that i can edit file, remove some lines or whatever but it still gives the same 899 of Data Actualy Read |
@cvertee Thanks for the information. Unfortunately, I'm not an expert on the web gateway or CSP. If you haven't already, I suggest you open a WRC case and give them a link to this issue and the $ZV of your server. It's probably pretty old since it only has Atelier API v3 (v4 was added in IRIS 2019.1 and Cache 2018.1.5?) so maybe this is a known CSP bug that's fixed in a later version. If you don't have WRC access then you can post this on the Developer Community (https://community.intersystems.com/) and someone there may be able to help. |
For some reason i get 'Failed to save file *.csp on the server' error in VSCode. Sometimes it does work, sometimes it doesn't. Even if i try to edit the same file i can get lucky and successfully compile it. But this probability is heavily random and can't figure out why this happens from time to time.
In the Output tab ObjectScript writes successful compiles or errors while compiling CLS files. But when such save error happens in CSP file there is just nothing.
Language Server Output with verbose level only writes this when saving, no errors (uri contains path to file://)
IRIS Version: 2020.1
VSCode Version: 1.87.2
OS: Windows 10
The text was updated successfully, but these errors were encountered: