-
Notifications
You must be signed in to change notification settings - Fork 5
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
METAR request causes crash #23
Comments
I will look into this matter later on this evening. When did you pull the code - recently or a few weeks ago? Release https://github.com/joergschultzelutter/mpad/releases/tag/0.42 contains several changes related to METAR / TAF data. For testing, you can use the included "parser_test" script: https://github.com/joergschultzelutter/mpad/blob/master/src/parser_test.py. This will enable the general parser and output generator without sending any content to APRS. |
I pulled the code yesterday. Just to make sure it was fresh.
…On Tue, Apr 9, 2024, 23:23 Joerg Schultze-Lutter ***@***.***> wrote:
I will look into this matter later on this evening. When did you pull the
code - recently or a few weeks ago? Release
https://github.com/joergschultzelutter/mpad/releases/tag/0.42 contains
several changes related to METAR / TAF data.
For testing, you can use the included "parser_test" script:
https://github.com/joergschultzelutter/mpad/blob/master/src/parser_test.py.
This will enable the general parser and output generator without sending
any content to APRS.
—
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB7OCCLXOCECHLZ4TRKZ5P3Y4TLHFAVCNFSM6AAAAABF7VN7NOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBWGYYTQMRWHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Thanks. From what I can tell from your log file, you tried to submit the command string "metars bli" via the parser, right? I tried to reproduce the issue, but to no avail: Nevertheless, I will add some safety measures to the current code and will create a new release - presumably not later than Saturday. |
That is correct. "Metars BLI". Could it be my beautifulsoup4 module is
broken? I can try freshening it up.
…On Wed, Apr 10, 2024, 11:34 Joerg Schultze-Lutter ***@***.***> wrote:
Thanks. From what I can tell from your log file, you tried to submit the
command string "metars bli" via the parser, right?
I tried to reproduce the issue, but to no avail:
mpad.parser_test.py.2024-04-10.20-29-20.jpg (view on web)
<https://github.com/joergschultzelutter/mpad/assets/76180229/85e3e34e-4487-49f1-8b26-05a426ccccf9>
Nevertheless, I will add some safety measures to the current code and will
create a new release - presumably not later than Saturday.
—
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB7OCCPP3DT6GQNTVFMCFK3Y4WA5FAVCNFSM6AAAAABF7VN7NOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBYGIYDKOBQGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
A pip refresh of beautifulsoup4 didn't change anything.
…On Wed, Apr 10, 2024 at 12:14 PM Chris Huchel ***@***.***> wrote:
That is correct. "Metars BLI". Could it be my beautifulsoup4 module is
broken? I can try freshening it up.
On Wed, Apr 10, 2024, 11:34 Joerg Schultze-Lutter <
***@***.***> wrote:
> Thanks. From what I can tell from your log file, you tried to submit the
> command string "metars bli" via the parser, right?
>
> I tried to reproduce the issue, but to no avail:
>
> mpad.parser_test.py.2024-04-10.20-29-20.jpg (view on web)
> <https://github.com/joergschultzelutter/mpad/assets/76180229/85e3e34e-4487-49f1-8b26-05a426ccccf9>
>
> Nevertheless, I will add some safety measures to the current code and
> will create a new release - presumably not later than Saturday.
>
> —
> Reply to this email directly, view it on GitHub
> <#23 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AB7OCCPP3DT6GQNTVFMCFK3Y4WA5FAVCNFSM6AAAAABF7VN7NOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBYGIYDKOBQGA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
I didn't expect things to be different; even though my Prod instance uses a fairly old BS4 version, my Dev envonment uses BS4's latest code version. Nevertheless, the code should have been able to pull the METAR data based on your call sign's location. Not sure if you're facing a local network issue here. But I will add some safety layer to the code, thus prveventing it to crash in case no content gets returned from the source web site. |
Thank you, Joerg. I'll pull the new code and run it again when I see a
change update.
…On Wed, Apr 10, 2024, 22:52 Joerg Schultze-Lutter ***@***.***> wrote:
I didn't expect things to be different; even though my Prod instance uses
a fairly old BS4 version, my Dev envonment uses BS4's latest code version.
Nevertheless, the code should have been able to pull the METAR data based
on your call sign's location. Not sure if you're facing a local network
issue here. But I will add some safety layer to the code, thus prveventing
it to crash in case no content gets returned from the source web site.
—
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB7OCCOTCNIQBJQOXNJAGULY4YQIVAVCNFSM6AAAAABF7VN7NOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBYHE3TCMRXGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I think I know what the problem is.
here's the issue in question: It seems as if the program was unable to determine the airport code that is closest to your call sign's location. Therefore, all other sub steps fail. I will aadd a few precautions to the code calling the Metar data. This will obviously not solve the issue with the missing airport information but will should no longer crash the program 😄 |
Got it! That makes sense. What pulls the airport info?
…On Thu, Apr 11, 2024, 06:08 Joerg Schultze-Lutter ***@***.***> wrote:
I think I know what the problem is.
2024-04-09 20:34:42,236 aprs_listener -INFO- {'latitude': 32.42417,
'longitude': -97.35533, 'altitude': 0.0, 'lasttime':
datetime.datetime(2024, 3, 2, 15, 33), 'comment': None, 'when': 'today',
'when_daytime': 'day', 'what': 'metar', 'units': 'imperial',
'message_callsign': 'S', 'users_callsign': 'KI7JOM-10', 'language': 'en',
'icao': None, 'human_readable_message': None, 'date_offset': 0,
'hour_offset': -1, 'satellite': None, 'repeater_band': None,
'repeater_mode': None, 'city': None, 'state': None, 'country': None,
'country_code': None, 'county': None, 'district': None, 'address': None,
'zipcode': None, 'cwop_id': None, 'street': None, 'street_number': None,
'users_latitude': 0.0, 'users_longitude': 0.0, 'number_of_results': 1,
'osm_special_phrase': None, 'dapnet_message': None, 'mail_recipient': None,
'force_outgoing_unicode_messages': False}
here's the issue in question:
'icao': None
It seems as if the program was unable to determine the airport code that
is closest to your call sign's location. Therefore, all other sub steps
fail. I will aadd a few precautions to the code calling the Metar data.
This will obviously not solve the issue with the missing airport
information but will should no longer crash the program 😄
—
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB7OCCLAJFPL444P2YY22Q3Y42DNNAVCNFSM6AAAAABF7VN7NOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBZGY2TONJVHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I've just released version 0.43. The only piece of code that you need to swap is the Some additional notes:
Related to your question, the METAR code gets triggered by the Hope this helps! |
Thanks, Joerg! I have a Kate night meeting, but I:I'll bet I can update my
instance tomorrow.
…On Thu, Apr 11, 2024, 12:50 Joerg Schultze-Lutter ***@***.***> wrote:
I've just released version 0.43
<https://github.com/joergschultzelutter/mpad/releases/tag/0.43>. The only
piece of code that you need to swap is the airport_data_modules.py code.
If you intend to test the code, feel free to pull the parser_test.py
module as well which will act as 'offline console', meaning that whatever
you feed into that module as input text should reflect the message that you
would get via radio. So if this code survives erroneous input, so will the
production version (fingers crossed 😄 )
Some additional notes:
- In case you never started the bot 'as is', it probably never created
the initial databases for you. Please check if the src/data_files
directory contains a file called airport_stations.txt - I bet that
this file is either missing OR is empty - which would explain why your
local instance fails the lookup. You need to have that file installed.
I've added a local copy
<https://github.com/joergschultzelutter/mpad/files/14950678/airport_stations.txt>,
but you can have the file created via
update_local_airport_stations_file from the airport_data_modules.py
module.
Related to your question, the METAR code gets triggered by the
output_generator.py file (function: generate_output_message_metar)
Hope this helps!
Joerg
—
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB7OCCPEUZJLWYL2TMGP5XLY43SQPAVCNFSM6AAAAABF7VN7NOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJQGQYTANJRGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I've created release 0.51 and suggest to use this release over 0.43. Among many changes, the |
I started up an instance on a Raspbery Pi (named mpad2 in case you see the traffic) and a buddy was helping me test it. He requested METARs and the script died. I fired it up again, and was able to replicate the issue with a different METAR request.
Did I break it, or was it broken when I pulled it?
The text was updated successfully, but these errors were encountered: