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

[BUG] "Not Found" when running "fo.launch_app()" - maybe due to version 1.4.0 #5459

Open
lejrn opened this issue Feb 3, 2025 · 7 comments
Open
Labels
bug Bug fixes

Comments

@lejrn
Copy link

lejrn commented Feb 3, 2025

I encountered two issues while using FiftyOne on Windows 11:

  1. When launching the app with fo.launch_app(), the browser opens to http://localhost:5151 but shows a black screen with a "Not Found" error.

Image

  1. After uninstalling version 1.4.0 and reinstalling the stable version 1.3.0, both the "Client Version" and "Database Version" still display as 1.4.0. This seems to indicate that the downgrade did not take effect, and the error persists.I expected that downgrading to 1.3.0 would correctly update the client and database versions and that the app would launch normally.

Image

Code to reproduce issue
session = fo.launch_app()

System information
OS Platform and Distribution: Windows 11
Python version: 3.10.2
FiftyOne version: 1.4.0 (attempted downgrade to 1.3.0)
FiftyOne installed from: pip (poetry)

Other info/logs:
When launching the app, the browser directs to http://localhost:5151 but returns a "Not Found" error.
Downgrading to version 1.3.0 does not update the client/database versions; they remain at 1.4.0.
No additional logs or tracebacks are available at this time.

Willingness to contribute:
Yes. I would be willing to contribute a fix for this bug with guidance from the FiftyOne community

@lejrn lejrn added the bug Bug fixes label Feb 3, 2025
@benjaminpkane
Copy link
Contributor

benjaminpkane commented Feb 3, 2025

Hi @lejrn. A Not Found response indicates the server cannot find the App index.html file located in ./path/to/fiftyone/server/static. This usually only happens when installing fiftyone from source. Though you note that you installed from pip (pypi)

Are you running FiftyOne through a proxy? Could you open the App in a browser tab with session.url and share the browser console error(s)?

@lejrn
Copy link
Author

lejrn commented Feb 3, 2025

Hey @benjaminpkane Thanks for your reply.
I don't have this ".../fiftyone/server/static" path. Is it in `C:\Users\user\.fiftyone"?
All I have in there is a folder named "var", in which there is another folder "lib" and two files: "weclome.json" and "uid".

When I said that I installed fifty-one from pip, I meant:

  1. git forked the latest develop branch of the fiftyone repo.
  2. git cloned it locally.
  3. Used "poetry add ../fiftyone --editable" to install it in my other main repo.
  4. Once done, the version was 1.4.0. It automatically upgraded the saved datasets from 1.3.0 to 1.4.0.
  5. Facing the "Not Found" error, I figured that I could at least reinstall 1.3.0. I first had to run "fiftyone migrate --all -v 1.3.0", then remove the editable install, then "poetry add fiftyone" which installed the 1.3.0 version.

As per the proxy, no, I don't. I use only the "http://localhost:5151".

I tried to delete and clear the caches of the Poetry environment, and reinstall (poetry install) with v1.2.0.

But when I try an empty dataset, I get this:

Image

which is a good sign.

I'm not sure if I resolved the issue, but now that I reinstalled v1.2.0, I noticed that it works as before. Not sure if I should close this issue or not...

@benjaminpkane
Copy link
Contributor

Ok, since you originally installed from source (i.e. the git repository) the App has to be built. Or, more generally, the install script should be used. Here is where the App step is

So it looks like you then installed a PyPI version next noting your screenshot. That has the App already built of course.

TLDR the install script should be used when working from the git repository ✨

@lejrn
Copy link
Author

lejrn commented Feb 4, 2025

Ok, since you originally installed from source (i.e. the git repository) the App has to be built. Or, more generally, the install script should be used. Here is where the App step is

So it looks like you then installed a PyPI version next noting your screenshot. That has the App already built of course.

TLDR the install script should be used when working from the git repository ✨

Thanks for this explanation! Just awesome. Does running this install.bat have the same effect of running:
poetry add ../fiftyone --editable, does it not?
If not (as implicitly noted), how come the latter install something indeed?

Beside that,

  1. Where should I run this install.bat file, in any path?
  2. If I use Poetry, does running this install.bat contradict any of the practices of Poetry? I can see there some "pip" commands but nothing with Poetry. In other words, is there a way to run this script using Poetry to persist consistency of Poetry?
  3. As per uninstalling, should I run just "pip uninstall ..." or some other specific script?

thanks!

@benjaminpkane
Copy link
Contributor

Thanks for this explanation! Just awesome. Does running this install.bat have the same effect of running:
poetry add ../fiftyone --editable, does it not?
If not (as implicitly noted), how come the latter install something indeed?

It will install the Python package via poetry, but it does not run the the App build. So it is slightly different. The install script can be modified to use poetry instead of pip and that will likely work.

The install script should be run in the root of the repository.

poetry uninstall or pip uninstall depending on the manager you use

@lejrn
Copy link
Author

lejrn commented Feb 10, 2025

@benjaminpkane Thank you for your explanation.

Actually, installing "install.bat" made things go batshit. Got a lot of "Not Found" errors, meaning that the App instance hasn't been properly built and set up.

I had to purify some environments, clear caches and delete folders to make sure everything was completely reset. Even when I tried to modify some stuff to Poetry, I felt like it wasn't going easily (and AI wasn't making it simpler).

I've come across this tutorial, even though it's for fiftyone-teams,
https://docs.voxel51.com/teams/installation.html#installation-with-poetry

Where it says:

If you are using poetry to install your dependencies rather than pip, you will need to follow instructions in the docs for installing from a private repository. The two key points are specifying the additional private source and declaring that the fiftyone module should be found there and not the default PyPI location.

Add source
In poetry v1.5, it is recommended to use an explicit package source.

poetry source add --priority=explicit fiftyone-teams https://pypi.fiftyone.ai/simple/
Prior to v1.5, you should use the deprecated secondary package source.

poetry source add --secondary fiftyone-teams https://pypi.fiftyone.ai/simple/
Configure credentials
poetry config http-basic.fiftyone-teams ${TOKEN} ""
Alternatively, you can specify the credentials in environment variables.

export POETRY_HTTP_BASIC_FIFTYONE_TEAMS_USERNAME="${TOKEN}"
export POETRY_HTTP_BASIC_FIFTYONE_TEAMS_PASSWORD=""
If you have trouble configuring the credentials, see more in the poetry docs here.

Add fiftyone dependency
Replace X.Y.Z with the proper version

poetry add --source fiftyone-teams fiftyone==X.Y.Z

And I thought. Could it be working similarly?
I'd be glad to hear some guidelines how to modify or adapt the current install.bat to properly install through poetry.
I'd do it myself and ping some PR, but I can't get it properly installed. lol

@benjaminpkane
Copy link
Contributor

I am OOO next week, but I will take a look when I am back! Or someone else may jump in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes
Projects
None yet
Development

No branches or pull requests

2 participants