-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
Unable to bundle sources to be send from a Linux Environment #2186
Comments
@jopheno I am not really sure where this error is coming from. Could you perhaps try uploading your debug files using this command, instead: sentry-cli debug-files upload --include-sources /path/to/files When using the Please let me know whether this suggestion fixes your problem. |
@szokeasaurusrex That I had already tried before, it works, and uploads just fine, but no sources are included... The main issue is that the sources are not being sent so when looking for the backtraces on sentry dashboard, it just doesn't work... On windows it works out of the box once it uploads the .pdb file, but on Linux, it doesn't work from the ELF as, I guess, it was supposed to... Idk where the other message went, but I also received on my email the following so I tried it out:
I compiled from sources and ran using the cargo run pointing the path where the application executable is (which is compiled with symbols) the source code is also beneath this path inside folders; gdb can track the source files just fine on my executable so I don't think it is neither permissions or cuz the executable source path is wrong; Using the command you passed earlier it didn't send any new information, on the sentry dashboard it still only sends symtab and unwind, but not sources; It also sends the binary as shown above, again, no sources included... Also by following some tutorial I also created a ELF file with only debug information to try it out: That file was done using the following command: Finally I also did: I tried on the project main folder and inside the build folder, using tree I extracted the folder structure:
First I was using the sentry-cli from tools which is the already built for linux on 2.37.0, just made a symb link; Then I compiled that version, and now I compiled the most recent version 2.38.0 as requested, still, not uploading sources... I also added this on CMake to auto upload:
|
Hi @jopheno, I had deleted that comment because I realized shortly after posting it that our release builds don't include debug symbols, rendering the backtrace useless. But, since you compiled the binary manually, you got the backtrace after all. From the backtrace, I can see that the error is originating from this line: Line 220 in 6d0729d
Digging deeper into the Since Sentry CLI tries to traverse the directory in order to find sources and debug files, is it perhaps possible that your directory contains (or links to) an external device which is not mounted or might be experiencing some other hardware issue? |
I tried reading all the files, and I saw no further issues on it, I don't think I am having any hardware issues and the only symbolic link I have is the one on sentry executable that can be seen on the tools folder on the structure I presented above... What else would you recommend me to test? I am running out of options on testing here... I even updated my Linux distribution to be the most up-to-date LTS version, nothing changed... There there is any further change you guys would like me to try, please let me know. |
@jopheno have you tried removing the symbolic link? |
Yes, even without the symbolic link; or inside the build folder;
|
@jopheno very strange. Do you get this same error running the command from any directory? Perhaps you could try making a new empty directory, and running the command there |
@UrbanNuke the |
Yes, the command only accepts an executable file, I understood it the hard way cuz the command doesn't provide any useful error message... The main issue I first opened this issue for is that, I cannot extract the source code from the executable... So, even tho I pass in the executable file it is not being able to extract the source code info and there is no way to debug this as far as I know... So basically our sentry solution is only worthy on development environment, on production that we use a Linux server, I just can't have the source code entangled with the solution to aid on evaluating the crashes; I can't consider this issue closed until I can get source code to be entangled with the web solution on Linux environment which does not have a .pdb file. What I would suggest is to improve this command to allow, first of all, to say that you must pass in a file and not a directory, but also to say something that could help us understand why it is not being able to extract the source code... Invalid file? Symbols not present? Arm incompatibility? GDB is being able to show the source code correctly on it, lines etc... So I would guess that there is nothing wrong with my executable, but idk, this just doesn't work for us on Sentry. |
@jopheno Are you still experiencing the |
Yes I do, when I pass in a directory; It should show an error instead saying to pass an executable file. The main issue which solution I am pursuing here is that I am not being able to send source code data to the sentry application on Linux environment... I tried using this command because the "automagically" didn't work, and I was trying to fetch some more information on why it wasn't doing the source bundle... But as it turns out, this command didn't help at all and I still cannot get this working on Linux... I showed the file structure, how the files are being sent to the web app, etc... I've ran out of ideas, the command doesn't provide any relevant information, even when being misused; If you guys have any other ways that I can use to diagnose the issue, or maybe what I am pursuing is currently unsupported and there is no place showing that... Who knows... |
Okay @jopheno, so to confirm, if you pass in a single file instead of a directory, are you still getting the
Also, what is the "automagically" you are referring to? I need you to describe your problem specifically so that I can help effectively here. |
Hey @jopheno, I am still waiting to hear back from you with more information about what exact problem you are experiencing with Sentry CLI right now. I have not been able to reproduce the "No such device" error, and I am also confused about whether you are still experiencing that problem. Can you please clarify what problem or problems you are experiencing now, and provide a reproduction that I can run to see the problems on my end? Without this information, we will need to close this issue as non-actionable |
I will be closing the issue, but here it is a break down for you guys to understand what happened and how this could be avoided. The main issue was: I was not able to obtain the source bundle out of the executable file. as stated on the title of this issue. The reason behind But then after I passed the executable file it extracted just fine right? Nope... it didn't, and the error message was So the bigger issue is not being able to bundle the sources, and being unable to debug the reason for it to not be working, with a very confusing docs that sometimes even describe the need of a file to map each source code to its path (but I guess not for native apps)... After many attempts on different machines I figured out the reason for it to not being bundling the sources in my special case here. So the reason for me to not be able to bundle the sources was because I was moving the files around; Idk if the source files are saved as relative to the executable file, but by moving the executable file and source code around during post build phases and later on trying to extract the source bundle it was simply not working... I hope that CLI command could at least say something like: But wait, I did say that GDB was being able to find the source files, right? Yes! And the reason why GDB was being able to see the source files was because the script I use to boot up with gdb was grabbing the executable file on the correct place and just setting the working directory to the other, so somehow it was resolving the path... I didn't look into it more if it was due to moving the executable file from a directory to another, from a partition to another or the source code on post build... So for everyone that still manages to have this issue "Being unable to bundle a native app source code to be sent from a Linux Environment", my advice is to avoid any post build phases and to run GDB to see if it is being able to fetch the source code (I was looking by crashing the app and seeing if it was being able to say the function positions on the file with the lines etc). So what I do recommend to be done on your end @szokeasaurusrex, please improve the error handling. The command is working, and after removing some post-build steps and reordering things I was able to get it to work, but the errors it returns they do not help on debugging at all, it took quite a while for me to understand the command, the issue and to get that fixed... I updated multiple times the sentry-cli release, I am currently using the v2.39.1, it could even be something on these earlier releases that got fixed, idk... But it is now working fine. |
Okay, thank you for the feedback @jopheno – it is very helpful. We are already aware that many of our error messages lack enough detail to be helpful, and we will try to improve them. We already have #2180 open to improve some of our error messages, and I just opened #2308 to address the error messages that you mentioned specifically. |
CLI Version
sentry-cli 2.37.0
Operating System and Architecture
Operating System Version
Ubuntu 22.04.3 LTS
Link to reproduction repository
No response
CLI Command
sentry-cli --log-level=debug debug-files bundle-sources .
Exact Reproduction Steps
Using a native C++ application (I used GDB to check if symbols were missing or if the source path was somehow wrong, but gdb was able to see all the sources just fine...)
Expected Results
It should correctly generate the source bundle debug files that would be uploaded to the sentry backend, but it didn't work;
Actual Results
I am unsure if I am using it wrongly, but I have no idea what
No such device
means, if I indeed add a path that doesn't exists, it does sayNo such file or directory
, but passing the executable, or the path where the executable is, or any path at all grants me withNo such device (os error 19)
Even tried adding a symbolic link so that I could execute using sentry-cli directly instead of having to pass the whole repository; Got no results;
Logs
The text was updated successfully, but these errors were encountered: