-
Notifications
You must be signed in to change notification settings - Fork 241
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
PyCharm: Unable to debug AWS lambda #908
Comments
I have the same problem - running locally in Docker works fine, also starting local debug mode of the lambda works just fine, but breakpoints can't be set because the file mapping is off.
It looks like the full path of the source file is passed on to the debugger and not the relative path, so the debug process won't be able to map it to the correct file. The last line shows the strange path: mount point /var/task and then the full original path to the file on the host machine. Other than that the code runs locally without problems.
|
I face the same issue. When can we expect the fix for this please. |
Built a Windows machine, and was able to reproduce it |
PyCharm lowercases all paths on Windows (https://github.com/JetBrains/intellij-community/blob/9d1d1a0b6e1661c14370e39e6c0d325879a615cc/python/src/com/jetbrains/python/debugger/PyLocalPositionConverter.java#L33) but our PathMapper is case sensitive. |
What I find odd though is that on a Windows machine Docker will mount the temp folder in %APPDATA%\Local\Temp\abc\def to /var/task, where a copy of the whole project folder has been placed. Or is that exactly what the PathMapper is supposed to resolve and can't because of lowercase / mixed case mismatch? |
PathMapper maps the IDEs view of the world on to the Dockers view and back. This way it knows which file to put the break point in. I have a fix I am testing |
Same problem but on Mac OS since PyCharm change to sam build |
@abrooksv After updating my aws toolkit today I now have the same issue with the new aws toolkit 1.3 (wasn't happening before) on linux. Did these changes break linux? ( I did not face this issue last week)
|
It should not have, since it was gated behind if your IDE is running on Windows. We do test debugger does work in our integration tests on Linux, so not sure what is causing it to fail. What is the actual path on your disk? |
@abrooksv Actually, the message there is the actual path on my disk. I'm confused as to why it "can't find the file". I definitely wasn't having this issue last week. Maybe a docker issue? The absolute path is indeed However I am not sure if that is correct for build/run time inside an image? template.yml
|
It should map to Will attempt to reproduce it. |
Is it weird then that I am seeing
and not a mention about Do I need to add the mapping manually to my interpreter? I am using venv not a remote interpreter. Ok thank you for your help. |
No, we handle the path mappings. The path is supposed to be translated to the location inside the container, but it fails to map. When it fails to map, it is passed as is in, this is why you see the real path in the message. |
That makes sense. FYI I even tried reverting to a 1.3EAP version from last week (Thursday/Friday) when I know the issue was not happening and my breakpoints were being hit and yet I still am getting the same issue. |
We have logs, but they are at the debug level. Let me try to remember how to enable debug logs in IntelliJ. |
Sounds good. If it helps at all I am using PyCharm professional 2019.1.1 and the only things I have done was update my linux kernel (5.0), some packages on my system as part of a rolling system update, and updated the aws toolkit to 1.3 and then I started receiving this behavior. |
Go to Help->Debug Log Settings and add |
Not sure if this maters, but when I look in |
If I had to guess, it is the /./ at the end of the first path. We should have cleaned the path, will try to repro with a unit test |
Ok thanks! If there is anything I can do to help please let me know. |
@abrooksv can confirm my issues are sorted. Built from source and tested. Great job! |
Since updating AWS Toolkit to 1.2 and Pycharm Community to 2019.1.1 I'm no longer able to debug any python lambda due to the:
pydev debugger: warning: trying to add breakpoint to file that does not exist
Find some advices to setup path mappings, but did not find such option AWS Lambda Run/Debug configurations.
Thank you for any help.
The text was updated successfully, but these errors were encountered: