5GEVE / mso-lo

MSO-LO is a REST API application to provide an ETSI SOL 005 (LifeCylcleManagement) compliant interface towards various NFV orchestrators.
Apache License 2.0
0 stars 4 forks source link

sqlite.py file error - development branch #26

Closed mifot closed 4 years ago

mifot commented 4 years ago

While building and running containers using docker-compose.yaml I got an error like below (from container logs)

Traceback (most recent call last):
  File "./app.py", line 24, in <module>
    import data.sqlite as sqlite
ModuleNotFoundError: No module named 'data.sqlite'

(...)

--- no python application found, check your startup logs for errors ---
[pid: 13|app: -1|req: -1/2] 172.22.0.1 () {32 vars in 346 bytes} [Tue May 19 10:35:44 2020] GET /nfvo => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

I checked container and it didn't contain sqlite.py in /usr/src/app/data directory. In my opinion is caused by volume mounted in that path (docker-compose.yaml file)

I fixed this error locally, so that's not very urgent :)

TheWall89 commented 4 years ago

I changed something in the database handling to support the site-inventory. Are you on the last commit for development? I'll check that.

TheWall89 commented 4 years ago

It builds fine for me. I'm on commit d29273e66313cc67c3f0a18133c3f51e6a6e9729.

Can you check your local gitignore file in the data folder? I changed that.

mifot commented 4 years ago

Containers were built successfully for me, but error was raised after containers were started. While running, 500 error was returned for each http message.

I used the same commit like you - d29273e

.gitignore file content below

ubuntu@msolo--server:~/mso-lo/adaptation_layer/data$ cat .gitignore 
/*.db
!.gitignore
ubuntu@msolo--server:~/mso-lo/adaptation_layer/data$ ls
__init__.py  sqlite.py

but file sqlite.py is missing in containers data directory. btw, it's not caused by .dockerignore

mifot commented 4 years ago

I attached a content ofdata directory inside container below

root@msolo--server:~/mso-lo# docker exec -it mso-lo bash
root@f46ee3694c06:/usr/src/app# cd data 
root@f46ee3694c06:/usr/src/app/data# ls
mso-lo.db
TheWall89 commented 4 years ago

Ok I know what happened. I should have not put code in the data folder. Let me fix this in a PR I'm working on otherwise I get a lot of conflicts. Gonna merge soon.

Ps. In the meantime, I think that if you remove the volume and rebuild without using cache it should work.

mifot commented 4 years ago

I fixed this error locally, maybe not in the most sophisticated way, but it's enough for robot tests. :) So it's not very urgent for me. Thanks

TheWall89 commented 4 years ago

This should be now fixed in development branch. Please check README, installation guide has changed a bit.

mifot commented 4 years ago

I tested it and works perfectly. (ver with disable site-inventory )

TheWall89 commented 4 years ago

Ok, closing :)