Unhelpful error message when writing malformed data to $GITHUB_ENV
See original GitHub issueDescribe the bug
When writing a particular string to $GITHUB_ENV
, the runner throws a nullref, i.e. Object reference not set to an instance of an object.
To Reproduce See https://github.community/t/nullref-when-writing-to-github-env-from-python/221606 . The following python code reproduces the issue.
import environ
with open(environ['GITHUB_ENV'], 'a') as f:
subcomment = """\
Please verify the following diffs:
- [ ] All articles ran in 0:00:56.697371: [en](https://wiki.tf/d/3106540) [ar](https://wiki.tf/d/3106518) [cs](https://wiki.tf/d/3106519) [da](https://wiki.tf/d/3106520) [de](https://wiki.tf/d/3106521) [es](https://wiki.tf/d/3106522) [fi](https://wiki.tf/d/3106523) [fr](https://wiki.tf/d/3106524) [hu](https://wiki.tf/d/3106525) [it](https://wiki.tf/d/3106526) [ja](https://wiki.tf/d/3106527) [ko](https://wiki.tf/d/3106528) [nl](https://wiki.tf/d/3106529) [no](https://wiki.tf/d/3106530) [pl](https://wiki.tf/d/3106531) [pt](https://wiki.tf/d/3106532) [pt-br](https://wiki.tf/d/3106533) [ro](https://wiki.tf/d/3106534) [ru](https://wiki.tf/d/3106535) [sv](https://wiki.tf/d/3106536) [tr](https://wiki.tf/d/3106537) [zh-hans](https://wiki.tf/d/3106538) [zh-hant](https://wiki.tf/d/3106539)
- [ ] Wanted templates ran in 0:00:37.264911: [en](https://wiki.tf/d/3106541)"""
f.write('GITHUB_COMMENT<<EOF')
f.write(subcomment)
f.write('EOF')
Expected behavior The bug here is about a lack of newline after the EOF marker. So, I would expect an error which says something like “malformed EOF marker”, or “EOF marker too long”. A very precient error might say “EOF marker missing newline”.
Runner Version and Platform
Runner version 2.285.1, Ubuntu 20.04.3
What’s not working?
https://github.com/jbzdarkid/TFWiki-scripts/runs/4728629242?check_suite_focus=true
Job Log Output
2022-01-06T15:26:24.2881206Z ##[group]Run python master.py pull_request
2022-01-06T15:26:24.2882292Z [36;1mpython master.py pull_request[0m
2022-01-06T15:26:24.2930406Z shell: /usr/bin/bash -e {0}
2022-01-06T15:26:24.2930893Z env:
2022-01-06T15:26:24.2931483Z pythonLocation: /opt/hostedtoolcache/Python/3.8.12/x64
2022-01-06T15:26:24.2932252Z LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.12/x64/lib
2022-01-06T15:26:24.2933714Z WIKI_USERNAME: ***
2022-01-06T15:26:24.2934234Z WIKI_PASSWORD: ***
2022-01-06T15:26:24.2934678Z ##[endgroup]
2022-01-06T15:26:24.4627453Z ##[error]Unable to process file command 'env' successfully.
2022-01-06T15:26:24.4642131Z ##[error]Object reference not set to an instance of an object.
2022-01-06T15:26:24.4820362Z ##[group]Run peter-evans/find-comment@v1
2022-01-06T15:26:24.4820930Z with:
2022-01-06T15:26:24.4821305Z issue-number: 13
2022-01-06T15:26:24.4821857Z comment-author: github-actions[bot]
2022-01-06T15:26:24.4822902Z token: ***
2022-01-06T15:26:24.4823414Z repository: jbzdarkid/TFWiki-scripts
2022-01-06T15:26:24.4823954Z direction: first
2022-01-06T15:26:24.4824355Z env:
2022-01-06T15:26:24.4824913Z pythonLocation: /opt/hostedtoolcache/Python/3.8.12/x64
2022-01-06T15:26:24.4825643Z LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.12/x64/lib
2022-01-06T15:26:24.4826209Z ##[endgroup]
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top Results From Across the Web
Malformed Factor error in melt.data.table
I don't think it's really a bug. Dataframes and by extension data.tables are not supposed to have multiple columns with the same name....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @jbzdarkid, I created a PR that will close the described issue. Thanks again for your contribution and further explanation of the bug!
Okay, now I see. I thought the problem was specifically the lack of a new line after the EOF marker and that the
subcomment
string itself is not important. Thanks for the clarification, I am working on solving the problem.