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

An error has occurred. Please consult with your administrator. #203

Closed
j0hnm4r5 opened this issue Mar 22, 2021 · 12 comments
Closed

An error has occurred. Please consult with your administrator. #203

j0hnm4r5 opened this issue Mar 22, 2021 · 12 comments
Assignees

Comments

@j0hnm4r5
Copy link

We're getting an error when trying to load a page containing a fueling station locator:

An error has occurred. Please consult with your administrator. Your support ID is:5730482191151852868

@reger
Copy link
Collaborator

reger commented Mar 22, 2021

@j0hnm4r5 do you mean a page of yours where you've embedded it? Or the one on the AFDC itself?

@j0hnm4r5
Copy link
Author

j0hnm4r5 commented Mar 22, 2021

@reger sorry; a page we host ourselves, using the "Embed Tool" data from the afdc site:

<div id="afdc-stations"><div id="afdc-stations-loading">Loading alternative fueling station locator...</div></div><script type="text/javascript">window.afdcStationsOptions = {"country":"US","localeCountry":"US","path":"/find/nearest","query":{"fuel":["CNG, LNG"]}}</script><script async defer src="https://widgets.nrel.gov/afdc/station-locator/assets/embed.js"></script><noscript>Please enable JavaScript to view the alternative fueling station locator.</noscript>

@j0hnm4r5
Copy link
Author

It seems to be working now! Did anything change on your end?

@j0hnm4r5
Copy link
Author

Ah, scratch that; it's inconsistent.

@j0hnm4r5 j0hnm4r5 reopened this Mar 22, 2021
@reger
Copy link
Collaborator

reger commented Mar 22, 2021

Okay, we'll look into it.

@reger reger self-assigned this Mar 22, 2021
@GUI
Copy link
Member

GUI commented Mar 23, 2021

@j0hnm4r5: Is the link where this tool is embedded public? If it is and that's something you could share, that might help us see if we can reproduce the issue. Thanks!

@j0hnm4r5
Copy link
Author

j0hnm4r5 commented Mar 23, 2021

Of course! Thanks for helping.

https://ngvamerica.org/fuel/fuel/ngv-station-map

Occasionally it loads fine, but most of the the time it throws the above error. It'll look like the page loads indefinitely, but if you go into the console, it'll say Uncaught SyntaxError: Unexpected token '<'. And if you click the line number, it will point to some HTML that was injected into the bundle that mentions the error and support ID.

Unfortunately, I don't know when the issue started (we just noticed internally a few days ago), but we did move the site to a new host recently. Maybe it's something with CORS or an API key (although I don't think we're using one)?

@j0hnm4r5
Copy link
Author

Hey guys — any progress by chance? I can take a deeper look at it on my end too, if you have any more info related to that support ID.

@GUI
Copy link
Member

GUI commented Apr 5, 2021

@j0hnm4r5: Sorry for the delay! So, our IT staff says that this is being blocked since the IP the request is coming from is flagged as a phishing IP. Now, I realize this is probably a false positive, but I am wondering if this maybe points to an issue with how the widget is being embedded on your site. I don't actually see our snippet code directly in your source code, particularly the <script async defer src="https://widgets.nrel.gov/afdc/station-locator/assets/embed.js"></script> line. It appears like perhaps something server-side is making this request to the javascript file, which I think is what's leading to this block. So I'm not entirely sure how all this is working, but are you doing something custom to embed the widget on the site? I'm not sure making a server-side request to our embed javascript code will work properly even if we address the IP block, unless it's un-cached (but it sort of looks like the results are being cached in https://ngvamerica.org/wp-content/cache/min/1/7fd8a897e2cae44407b2a4241cd30eb9.js).

Does that make sense or give you some ideas? We only really support directly embedding the widget using the source code provided on our page. But if you're needing to do something more custom, let us know how specifically you need it to work, and we can maybe try to figure something out.

@j0hnm4r5
Copy link
Author

j0hnm4r5 commented Apr 5, 2021

Interesting. We just moved the site from a self-hosted AWS instance, to one hosted by WPEngine (which I suppose could be hosting our site on a shared IP with other sites associated with Phishing).

The site is built in a WordPress page builder (Beaver Builder), which totally could be doing something with delaying the request. I inherited the site from our creative team, and unfortunately redoing it with actual code isn't in the cards right now. The following is embedded as an "HTML Block" within the page:

<div id="afdc-stations">
	<div id="afdc-stations-loading">Loading alternative fueling station locator...</div>
</div>
<script type="text/javascript">window.afdcStationsOptions = { "country": "US", "localeCountry": "US", "path": "/find/nearest", "query": { "fuel": ["CNG, LNG"] } }</script>
<script async defer src="https://widgets.nrel.gov/afdc/station-locator/assets/embed.js"></script>
<noscript>Please enable JavaScript to view the alternative fueling station locator.</noscript>

The page does occasionally load okay on my machine (usually when I'm logged into the Wordpress admin, which I think skips the cache), and when it does, the source does contain that embed code in full.

If it helps, the embed was working perfectly fine before we moved to WPEngine, so whitelisting the IP might just solve the issue outright.

@j0hnm4r5
Copy link
Author

Have you had a chance to whitelist the IP address yet (or is that even possible)?

@j0hnm4r5
Copy link
Author

I figured out a workaround! Hitting the page with the query fragment already in the URL seems to trick everything into working.

https://ngvamerica.org/fuel/ngv-station-map/?f#/find/nearest?fuel=CNG,%20LNG

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