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

push.json not being loaded correctly for Push Notification #1061

Open
jiji14 opened this issue Mar 20, 2024 · 5 comments
Open

push.json not being loaded correctly for Push Notification #1061

jiji14 opened this issue Mar 20, 2024 · 5 comments

Comments

@jiji14
Copy link

jiji14 commented Mar 20, 2024

While testing the push notification feature on the Admin dashboard, an error occurred due to the inability to load the push_config_file in notify_interface.py in the server code (see below).

try:
    push_config_file = open('conf/net/ext_service/push.json')
    push_config = json.load(push_config_file)
    push_config_file.close()
except:
    logging.warning("push service not configured, push notifications not supported")

Our initial assumption was that the push.json file might be missing in the staging environment. However, upon further examination of the error log, we confirmed that push.json does exist. Therefore, we need to investigate further to determine why it is not being loaded correctly.

@jiji14
Copy link
Author

jiji14 commented Mar 20, 2024

@MukuFlash03 Can you please share the screenshots related to this issue?

@MukuFlash03
Copy link
Contributor

So I took a look at the logs in AWS for admin-dash staging and found the two errors in the latest logs.
I believe these might be related to these two bugs you've mentioned during your initial observations:

[ Admin Dashboard Bugs ]
Trip trend data doesn't show up on Home
Push notification fails

Here are the respective screenshots of the logs:

  1. "NameError: name 'push_config' is not defined"
    Possibly related to: Push notification fails
Screen Shot 2024-03-20 at 11 35 40 AM
  1. "ValueError: time data"
    Possibly related to: Trip trend data doesn't show up on Home
Screen Shot 2024-03-20 at 11 42 23 AM

@MukuFlash03
Copy link
Contributor

MukuFlash03 commented Mar 20, 2024

Our initial assumption was that the push.json file might be missing in the staging environment. However, upon further examination of the error log, we confirmed that push.json does exist. Therefore, we need to investigate further to determine why it is not being loaded correctly.

The push.json file is supposed to be based off of the template / sample JSON file present in the e-mission-server.

So, we took a look at the internal server repository and saw that the analysis container does have the push.json file available with the actual values filled in place of the sample values.

I believe we were incorrect in assuming the purpose of this specific internal push.json file.
We initially assumed that the file is present and despite being present it is not being loaded.

I believe, the correct explanation would be that this file is for the analysis container specifically hence it is not available to the admin-dashboard container.
The admin-dashboard container does not have the push.json file in the internal repo which is where it builds the image from the base server image from the public version which in turn doesn't have the push.json file but only has a push.json.sample file.

So, need to figure out whether to add the file internally in the admin-dashboard repo?

@nataliejschultz For visibility, as it seems related to our redesign process in this issue.

@jiji14
Copy link
Author

jiji14 commented Mar 20, 2024

@MukuFlash03 Thanks for the clarification! 👍
@achasmita @shankari Also for visibility

@shankari
Copy link
Contributor

The push notifications were not expected to work.

  • I had asked @achasmita to get the push notification page to work.
  • She had asked to enable the commented out notification for testing.

So, need to figure out whether to add the file internally in the admin-dashboard repo?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants