Skip to content
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

Not able to validate or lemmatise: project code not found #129

Closed
ofeliatweets opened this issue Dec 9, 2022 · 17 comments · Fixed by #132
Closed

Not able to validate or lemmatise: project code not found #129

ofeliatweets opened this issue Dec 9, 2022 · 17 comments · Fixed by #132
Assignees
Labels
atf bug Something isn't working

Comments

@ofeliatweets
Copy link

Describe the problem
I am not able to validate or lemmatise my ATF files. I get the "project code not found in ATF" error. The files work fine in NAMMU. My colleague is having the same issue.

To Reproduce
Basically I open an ATF file, click validate or lemmatise and get the error.

Screenshots
image
image

User desktop system (please complete the following information):

  • OS: Windows
  • Version 10.0.19043

Thanks!!

@giordano
Copy link
Collaborator

giordano commented Dec 9, 2022

Thanks a lot for the report! Would it be possible for you to share the file, if it doesn't contain anything non-public? You can drag and drop it in the comment box below. I'm wondering if this problem is related to the line-ending of your file.

@ofeliatweets
Copy link
Author

No problem - it appears github won't allow me to attach it as it is an unsupported type so I save it as a txt - hopefully that works.
babcityATFtest.txt

@giordano giordano added bug Something isn't working atf labels Dec 9, 2022
@giordano
Copy link
Collaborator

giordano commented Dec 9, 2022

Yes, the extension is no problem, I can rename it afterwards. I'll take a look, thanks!

@ofeliatweets
Copy link
Author

Thank you! Note I get the same error even when there's no lemmas or even when I have just the header lines, not sure if that helps narrow the issue down.

@giordano
Copy link
Collaborator

giordano commented Dec 9, 2022

Unfortunately I can't reproduce the problem you reported with your file on my machine. However, it'd be helpful to have one more bit of information: what version of Nisaba are you using? You can find the number if you go to the list of extensions (press Ctrl + Shift + X or click on the
image
icon on the left sidebar), search for "nisaba" and then click on it. You should get a page like
image
for me the version number is 1.3.0. I'm asking just in case you're somehow using an older version and the code I'm looking at is different than what you're running on your machine. Thanks!

@ofeliatweets
Copy link
Author

Sadly I am also running 1.3.0
My colleague is experiencing the same issues as myself so at least I know it's not only me.

@giordano
Copy link
Collaborator

giordano commented Dec 9, 2022

@ofeliatweets sorry, another question: what version of Visual Studio Code are you using? You can find it in the menu Help -> About.

I trust you're experiencing this issue, but I'm having a hard time figuring out what can be the problem with detecting the project name, the code is relatively straightforward, so I'm trying to collect as much information as possible about your configuration. A colleague just tried to run lemmatisation on your file using Nisaba 1.3.0 + VS Code 1.74.0 + Windows 10 and they could also not reproduce your error ☹️

@ofeliatweets
Copy link
Author

Oh, I totally understand it's hard to suggest a fix if you can't replicate it! My VisualStudio is also 1.74.0 :(

@giordano
Copy link
Collaborator

giordano commented Dec 9, 2022

The problem is this: we extract the project code, that we need to pass to the server for doing the lemmatisation, from the file itself, by searching for lines starting with #project:. This is why I initially thought about this being a problem with line-ending: Windows and Linux/macOS use different characters to identify line endings, so it may happen (but I need to verify this hypothesis, and if correct we have to deal with this situation appropriately) that if you try to edit on Windows a file created on Linux or macOS the line ending may be identified incorrectly, and so searching for lines starting with #project: may not work as expected. But the file you sent us does have Windows-style line ending! As a sanity check, in the right corner of the blue bar at the bottom of VS Code you should see something like this:

image

The acronym between "UTF-8" and "Oracc ATF" in my screenshot, "CRLF", indicates the Windows-style line ending character (Carriage Return and Line Feed). Do you also have "CRLF" there? Or do you have only "LF" (line feed), which would indicate Linux/macOS-style line ending?

If you also have CRLF, then I have very little clue of what could be the problem. One issue we had early on during the development of Nisaba is that the buttons for lemmatisation and validation were active even when the focus was not inside the text editor area, so that clicking on the button while the focus was elsewhere would result in errors like the one you're seeing because we couldn't extract the ATF text (and hence the project code) from the right place. But we should have already fixed this bug months ago, and I can't make the buttons appear unless focus is inside the document editing area. Can you please make sure you have the blinking cursor in the text area of the document before clicking on the lemmatisation button? I'd expect that's already the case (otherwise you shouldn't see the buttons in the first place!), but if not then that'd be something else we'd have to look into.

Thanks for your patience!

@ofeliatweets
Copy link
Author

ofeliatweets commented Dec 13, 2022

Wow!!! I think you may have found it. So firstly my line is purple (maybe that's stylistic but just in case, letting you know) and you can see it is LF not CRLF and ATF not Oracc ATF. So after switching from LF to CRLF it seems to work!!! I can't change it to Oracc ATF as that doesn't seem to be an option for me though. I have attached the screenshot of original settings, the settings that seem to work, and options I get for changing ATF.
image
image
image
image

@giordano
Copy link
Collaborator

Ok, so the problem was indeed related to the line-ending as I initially thought, but the file you sent over did have CRLF line endings 😕 I wonder if that was modified by GitHub when you uploaded it, that'd be very unfortunate.

Anyway, so, the problem is that we need to allow for handling LF line endings on Windows as well. Thanks a lot for getting back, that was very helpful!

@ofeliatweets
Copy link
Author

Thank you so much!

@giordano
Copy link
Collaborator

giordano commented Dec 13, 2022

I pushed a fix in #132, including a test to make sure this problem doesn't arise again in the future, but you'll be able to enjoy the fix in the next version of Nisaba, 1.4.0, which I'm aiming to publish by next week. I'll let you know when that'll be available. Thanks again for the help!

@giordano
Copy link
Collaborator

@ofeliatweets today we released v1.4.1 of Nisaba which includes the fix for this issue. If you go to the list of extensions of VS Code and click on the Nisaba item, you should find an option to update it to the latest release (v1.4.1). With this, you should finally be able to lemmatise and validate files with both CRLF and LF line ending without problems. Do let us know if you have any other questions, and thanks again for the help in tracking down the bug!

@ofeliatweets
Copy link
Author

Hi there! Everything seemed to be working on Friday but there's a new error now when I try to lemmatise or validate:
An error has occurred: Error during communication with server: Unexpected message from server: /home/oracc/tmp/sop/svGbP3/status not found (-1) The log may contain more details.****
I wonder if it has something to do with the new release? I was getting the error yesterday and still getting it today.

@giordano
Copy link
Collaborator

Hi, thanks for the report, I can confirm I can also reproduce the error but this kind of problem is outside of our control and is generally due to a problem on the remote Oracc server.

@ofeliatweets
Copy link
Author

Ah yes, I just checked and Nammu is showing "Couldn't get server logs" error. Hopefully they fix it soon! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
atf bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants