ReferenceError: gf is not defined

I have a grafana service installed on Fargate.
Version 10.0.3 (grafana/grafana-oss:10.0.3-ubuntu) installation using docker.
I need to resolve a problem with the BigQuery datasource plugin. And upon recommendation from Grafana Support, you should update to version 10.2.x. We chose version 10.2.3-ubuntu.
Changing the version in the dockerfile and updating the fargate is going smoothly. However, when opening grafana we are receiving the error below:
ReferenceError: gf is not defined

We have already tried different alternatives without having to change any item in the docker image.

As it is a very recent version, I did not find any literature that would help with the solution.

Does anyone have any suggestions?

Check the browser console for error. Try to create the same dashboard with the same panels/queries, but from the scratch manually. Don’t use any thirdparty plugins/panels.

I think I understand your suggestion and thanks for the feedback. However, the problem occurs after installing the new version of Grafana (10.2.3). Everything appears fine on the login screen, but when logging into Grafana, the initial screen is not even displayed, the error appears immediately. It is not a specific problem with a dashboard.

Correct. But problem seems to be in the frontend code, so checking of server logs may not give you idea what’s a problem = browser console is the right place where to start investigation.
Of course delete all caches, cookies in the browser, so there is no reference to old code in the browser at all.

1 Like

Can you spin up a fresh install with a different name and port and see what happens

docker run -d --name=grafana-kimchi -p 3999:3000 grafana/grafana-oss:10.2.3-ubuntu
``

I will do a more detailed check of the log. Thanks for the sugestion. But the fact is that the application runs in a container. It’s as if it were an application installed from scratch. The difference is that it uses the same database. But if I return to version 10.0.3 the application works normally again.

As I am using FARGATE from AWS, running Docker is up to the platform. The build occurs in a pipeline. I can try to change the name in the Taks Definition, but I don’t think it will be a problem.
How to validate a frontend problem in this case to try to resolve it? It appears that a library was updated and the references were not.

That sounds like “It works on my computer ™”. Fact is that container doesn’t stop user to do silly things.

I think you are not saying full picture about your setup - there can be many moving parts between Grafana container and user browser. (Like this chap). People especially on AWS are adding services to their stack without thinking about consequences (e.g. hooray, there is AWS caching, WAF, CloudFront, Global accelator, … let’s use it to be safe, faster, cool, …).
And you have symptons for this. It looks like your browser may have old frontend code, but ECS task served new code, so it is messing (e.g. gf is not defined).
I asked “Of course delete all caches, cookies in the browser, so there is no reference to old code in the browser at all.” but you didn’t respond. I appreciate if you follow my requests, otherwise we can save your/my time.

1 Like

I’m sorry for not making it clear in the previous message. In fact, I have already cleared the browser cache, we have already tried with other browsers and on other machines. We redid the service on AWS Fargate and I simply get the impression that the image is missing something.
The architecture is relatively simple, it is an AWS Fargate behind an application load balancer. In fargate it is consumed by a grafana image in version 10.2.3. I’m not using WAF, Cloud Front or any other service. The service is accessed directly from the application load balancer’s DNS. Regarding the logs, we did not find anything relevant in relation to errors in updating the version.
We already did this when executing the front-end without the cache. Below is an image for evidence.

Thank you for your support so far.

Could you provide public URL, pls? Do you use arm or amd architecture?

so what flavor of grafana do they provide you with? is this official image?

I’m sorry the application is on the company’s internal network.
We are using the X86_64 architecture.

Yes, it is an official image. We are using the “grafana/grafana-oss:10.2.3-ubuntu” image for the docker build

1 Like

You can still start new instance in public subnet. You can configure sec. group per task, so you won’t need ALB - it can be pure internet access to ECS task directly.

Unfortunately, company policy does not allow exporting URLs. I tried, but without success.
But I managed to resolve the issue. In my scenario I use a dockerfile that changes some aspects of the frontend.

I removed exactly the point:

Blockquote
find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|({target:“_blank”,id:“updateVersion”,.*grafana_footer"})|()|g ’ {} ;

This change was impairing the correct functioning of the frontend. I had to remove this implementation in the dockerfile and the frontend started to work correctly. Which makes perfect sense, since it’s a direct change to the frontend structure. I hadn’t noticed the interference, but luckily I noticed it in time to correct it.

Thank you everyone for your support in trying to resolve the problem, jangaraj and yosiasz.

1 Like