URL error and gaierror

we checked the function in our script console, I got the result

But, i just use same method in my perspective project > in one component
am facing the following error.

Please post formatted code - not pictures of code. That way we can copy them into our Script Console and into our answers. You can edit your question using the pencil icon.

How have you bound the component to the function?
I notice that URLPath is declared outside the def but I don't know if that is a problem.

I also notice that you are using system.tag.read which doesn't appear in the 8.1 documentation so it has probably been depreciated in favour of
system.tag.readBlocking - Ignition User Manual 8.1 - Ignition Documentation and
system.tag.readAsync - Ignition User Manual 8.1 - Ignition Documentation.

The 'gai' in gaierror seems to be "get address info".