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

Exits After "Querying Notion database" with no error message #10

Open
ganeshh123 opened this issue Jan 29, 2022 · 15 comments
Open

Exits After "Querying Notion database" with no error message #10

ganeshh123 opened this issue Jan 29, 2022 · 15 comments

Comments

@ganeshh123
Copy link

After compiling a binary and running, it shows the spinner with "Querying Notion database" and then just exits with no error message.

@xzebra
Copy link
Owner

xzebra commented Jan 30, 2022

It just says “Querying Notion database”? Or it says “❌ Querying Notion database: “?

@xzebra
Copy link
Owner

xzebra commented Jan 30, 2022

If it’s the first one, I don’t know how to test that and may need some more context. If it is the second one, the problem may be of the notion-api library.

Anyways, there is a big pr open and things may change a lot so I wouldn’t worry much about current bugs.

@ganeshh123
Copy link
Author

It's the first one, see below:
notion-blog-issues-10
Sorry, I guess its not very helpful to debug without any errors. I look forward to what the PR brings, thanks a lot of starting this project, its exactly what I need!

@saltbo
Copy link

saltbo commented Feb 1, 2022

you can try the pr: https://github.com/saltbo/notion-md-gen/tree/fly

welcome any feedback for me

@ganeshh123
Copy link
Author

Hmm, the install doesn't work for me:

$ brew install notion-md-gen
Running `brew update --preinstall`...
Warning: No available formula with the name "notion-md-gen".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

@saltbo
Copy link

saltbo commented Feb 5, 2022

it's not ready

@ganeshh123
Copy link
Author

Allright, could you provide some instructions to compile it?

@saltbo
Copy link

saltbo commented Feb 5, 2022

you can exec 'go install .' in the project

then exec '$GOPATH/bin/notion-md-gen'

@xzebra
Copy link
Owner

xzebra commented Feb 6, 2022

I look forward to what the PR brings, thanks a lot of starting this project, its exactly what I need!

Hi @ganeshh123, I have discarded the idea of integrating the changes of the pull request so I can help you try to find a solution for this problem or you can choose the @saltbo repository which is a more generic generator.

In case you want to keep with this project, I will need some more info about the problem as I don't know how to replicate it. Could you try to run it on another system or architecture with the same configuration? As I see that you are running it from WSL and it is known by having unexpected bugs.

@ganeshh123
Copy link
Author

Thanks for your offer to help, lets try and figure it out. I need a solution for Hugo specifically, so this is more suitable for me.

As per your suggestion, I tried building it for native Windows, but I get this error:

C:\Code\notion-blog>go build -o ./bin/main cmd/main/main.go
# github.com/janeczku/go-spinner
C:\Users\ganesh\go\pkg\mod\github.com\janeczku\go-spinner@v0.0.0-20150530144529-cf8ef1d64394\spinner.go:39:25: cannot use syscall.Stdout (type syscall.Handle) as type int in argument to terminal.IsTerminal

Maybe the Spinner module doesn't work on Windows?

Anyway in the Linux build, this is my config:

{
	"databaseID": "723a5a8dc0e04461b75b58a50e490024",
	"imagesLink": "",
	"imagesFolder": "posts",
	"contentFolder": "posts",
	"propertyTags": "Tags",
}

Some fields are missing as I don't yet have a blog, as I just want to see how the markdowns look, and I don't have a Description, or Status property for the pages. The database is public, so you can examine it yourself here:
https://notion.so/723a5a8dc0e04461b75b58a50e490024

Is it mandatory to have the Status and Description properties on the pages? If so, can they be made optional?

My .env file looks like this:

NOTION_SECRET=secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The token here has edit access to the database.

Hope some of this info is useful, if you need anything else please let me know.

@saltbo
Copy link

saltbo commented Feb 7, 2022

The package github.com/janeczku/go-spinner seems that windows is not supported. I has replace it by github.com/briandowns/spinner

bonaysoft/notion-md-gen@0a6362f#diff-654572202a140b99457b37d9f657f0382e7f0ff32757b06ff3813395c968bd4c

@xzebra
Copy link
Owner

xzebra commented Feb 7, 2022

As per your suggestion, I tried building it for native Windows, but I get this error:

As @saltbo mentioned, go-spinner may not be compatible with Windows. I can try changing to the mentioned package.

and I don't have a Description, or Status property for the pages.

The application is performing a filtered fetch from the database, but if no filter-prop or published-value are specified, it should return a nil, which should return all elements from the database.

q, err := client.Database.Query(context.Background(), notionapi.DatabaseID(config.DatabaseID),
		&notionapi.DatabaseQueryRequest{
			CompoundFilter: filterFromConfig(config), // <- will be nil
			PageSize:       100,
		})

So I'm not quite sure of what is going on here.

@ganeshh123
Copy link
Author

Sorry for the delayed reply. I tried it with another database (https://ganeshh123.notion.site/3967580d3fb64cb4a4f0a9493ece6ed6) with very simple properties but its still having the same issues. I even tried adding the properties from the example config file, but I am still getting the same issue :(

@xzebra
Copy link
Owner

xzebra commented Apr 4, 2022

Just to make sure, did you create an integration and shared those databases to the integration?

To create an integration, use the following link: https://www.notion.so/my-integrations

I have it with the following permissions:
image
I guess some of them may be omitted but it's the one I use.

On Notion, go to the database page. Then press Share button and make sure you shared the page with the integration you created.
image

@ganeshh123
Copy link
Author

ganeshh123 commented Apr 5, 2022

Thanks a lot for trying to help, this is my integration, and the secret is in my .env.
image
And this is the sharing to the integration for the database:
image
Not sure what else to try :(

I really dont know much about the Go language but would it be possible for you to compile a Windows executable for me to try?

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

No branches or pull requests

3 participants