Giter Site home page Giter Site logo

flask-eureka's People

Contributors

artemrys avatar elviejokike avatar freezor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flask-eureka's Issues

Failing to get port in Windows

While trying to register flask service, Eureka client tries to get ipv4 with this code:
def ipv4(self): if self.system == 'Darwin': ipv4 = getoutput("ifconfig " + self.iface + " | grep 'inet ' | awk '{ print $2 }'") else: ipv4 = getoutput("ifconfig " + self.iface + " | grep 'inet addr' | awk '{ print $2 }'") ipv4 = ipv4.split(':')[1]
Here command ifconfig is called in terminal. However, there's no such command in Windows terminal, so getoutput function result is '"ifconfig" ­Ґ пў«пҐвбп ў­гв७­Ґ© Ё«Ё ў­Ґи­Ґ© Є®¬ ­¤®©, ЁбЇ®«­пҐ¬®© Їа®Ја ¬¬®© Ё«Ё Ї ЄҐв­л¬ д ©«®¬.'. By decoding this, I get '"ifconfig" не является внутренней или внешней командой, исполняемой программой или пакетным файлом.', which is the message that command was not found in Russian. Unsuprisingly, the whole library won't work on Windows.

Configuration won't load

Hi,

I got a running Spring Netflix Eureka Server and tried to connect a flask client to it.
When I try to start the Flask Server I get the following error message and I can't find out where the error is.

Der Befehl ""ifconfig en0 | grep 'inet addr' | awk '{ print $2 }'"" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Traceback (most recent call last):
  File "C:/Projects/PDA/web-crawler-service/webcrawlerservice/WebCrawlerService.py", line 62, in <module>
    connect_to_eureka()
  File "C:/Projects/PDA/web-crawler-service/webcrawlerservice/WebCrawlerService.py", line 33, in connect_to_eureka
    eureka.register_service(name="my-flask-service")
  File "C:\Projects\playground\venv1\lib\site-packages\flask_eureka\eureka.py", line 57, in register_service
    **kwargs)
  File "C:\Projects\playground\venv1\lib\site-packages\flask_eureka\eurekaclient.py", line 95, in __init__
    host_info = HostInfo().get()
  File "C:\Projects\playground\venv1\lib\site-packages\flask_eureka\hostinfo.py", line 34, in get
    'IPv4': self.ipv4(),
  File "C:\Projects\playground\venv1\lib\site-packages\flask_eureka\hostinfo.py", line 52, in ipv4
    ipv4 = getoutput("ifconfig " + self.iface + " | grep 'inet addr' | awk '{ print $2 }'")
  File "C:\Projects\playground\venv1\lib\site-packages\flask_eureka\hostinfo.py", line 10, in getoutput
    return subprocess.check_output([cmd], shell=True)
  File "C:\Python27\Lib\subprocess.py", line 219, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '["ifconfig en0 | grep 'inet addr' | awk '{ print $2 }'"]' returned non-zero exit status 1

Attached you can find my configuration file and the python script which I am running.

My Spring Eureka Server has the following configuration:

spring:
  application:
    name: eureka-service
server:
  port: 8761
eureka:
  client:
    registerWithEureka: false
    fetchRegistry: false
    serviceUrl:
      defaultZone: http://localhost:8761/

Thanks

webcrawlerservice.zip

en0: error fetching interface information: Device not found

Traceback (most recent call last):
  File "app2.py", line 17, in <module>
    eureka.register_service(name="my-flask-service")
  File "/home/modak/Codebase/Modak/git_repos/enod-ws-v2.0/flask_eureka/eureka.py", line 57, in register_service
    **kwargs)
  File "/home/modak/Codebase/Modak/git_repos/enod-ws-v2.0/flask_eureka/eurekaclient.py", line 93, in __init__
    host_info = HostInfo().get()
  File "/home/modak/Codebase/Modak/git_repos/enod-ws-v2.0/flask_eureka/hostinfo.py", line 35, in get
    'IPv4': self.ipv4(),
  File "/home/modak/Codebase/Modak/git_repos/enod-ws-v2.0/flask_eureka/hostinfo.py", line 54, in ipv4
    ipv4 = ipv4.split(':')[1]
IndexError: list index out of range
==============================================================
Running on VMWare Ubuntu 16.04 
ubuntu $ ifconfig
docker0   Link encap:Ethernet  HWaddr 02:42:03:58:88:94  
          inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::42:3ff:fe58:8894/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:270 errors:0 dropped:0 overruns:0 frame:0
          TX packets:516 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:213329 (213.3 KB)  TX bytes:80733 (80.7 KB)

ens33     Link encap:Ethernet  HWaddr 00:0c:29:35:45:d4  
          inet addr:192.168.206.135  Bcast:192.168.206.255  Mask:255.255.255.0
          inet6 addr: fe80::52f2:ed1:d777:2587/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:94076 errors:0 dropped:0 overruns:0 frame:0
          TX packets:53932 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:92354926 (92.3 MB)  TX bytes:6995641 (6.9 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:39081 errors:0 dropped:0 overruns:0 frame:0
          TX packets:39081 errors:0 dropped:0 overruns:0 carrier:0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.