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
In some cases, error message "specified line no longer in file, maybe it changed?" is not because the file changed #16456
Comments
+1 |
1 similar comment
+1 |
+1 |
+1 |
I found it is my scripts' problem, the quotation in the last line of my script is not matched. |
+1 |
Same problem with quotation. Seems bad that error is so bad that whole file is considered broken, and no way to point line except manual inspection. |
+1 |
The error message can also be produced with this playbook ---
- hosts: localhost
tasks:
- debug:
msg: "unterminated quoted string notice as it is colorized, you may miss the missing quote.
|
Can anyone test with #73241 to see if that fixes the issue? |
ISSUE TYPE
COMPONENT NAME
ansible core
ANSIBLE VERSION
CONFIGURATION
N/A
OS / ENVIRONMENT
N/A
SUMMARY
The error message
(specified line no longer in file, maybe it changed?)
is caused when there is a syntax error on the last line, and that line also contains variable interpolation. The error message points to the line after the end of the file and prints the above message.STEPS TO REPRODUCE
Using a playbook site.yml
With two roles:
a
,b
When roles/a/meta/main.yml contains this broken syntax including variable interpolation on the last line of yaml content of the file
And the playbook is run with
ansible-playbook site.yml
Then it produces an error message which points to a line in the file which doesn't exist:
EXPECTED RESULTS
I expected to find the file had changed and this was a temporary error, but it occurs consistently.
I know the syntax is incorrect, however the error message about the file changing is very confusing. I'm able to guess the error is on the previous line, but I don't think the error should reference a line that doesn't exist at all in the file.
I think it makes it difficult to debug and as it occurs in such limited circumstances it's not referenced much, and the phrase isn't easy to search for.
I either expected the error to relate to a line in the given file, or be shown the interpolated output with the line that caused the error.
This seems related to #14549 in general, but opened separately as it may be caused by a different mechanism. It may be caused by external parser library so this might belong further upstream.
The text was updated successfully, but these errors were encountered: