Putting some time into this again as I want to get it working on OSX.
When pulling the image from the repo there isn't an M1 version of the image. You must build it yourself. Not an issue directly but worth noting:
no matching manifest for linux/arm64/v8 in the manifest list entries
No port is exposed when running the api and consumer commands. In the read me it states:
http://localhost:45001/ is ready (port may varies depend on your .env.)
However I cannot access that and docker doesn't report any exposed ports. Having ran docker ps
I don't see anything available and Code throws "No valid ports are available" when connecting through the docker extension.
I've looked through the code but I'm not a go dev and don't see where this would updated. For Mac specifically I don't think you can bind to 127.0.0.1 directly, it needs to use 0.0.0.0.
After migrating database tables, I run
and recieve this error:
[+] Running 1/0
⠿ Container akatsuki-cron-fill Created 0.1s
Attaching to akatsuki-cron-fill
akatsuki-cron-fill | 2023-04-14T10:45:25Z INF config initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF newrelic initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF cache initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF database initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF pubsub initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF repository anime initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF repository genre initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF repository studio initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF repository empty id initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF repository mal initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF repository publisher initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF service initialized
akatsuki-cron-fill | 2023-04-14T10:45:26Z INF filling missing data...
akatsuki-cron-fill | 2023-04-14T10:45:26Z ERR cron_fill.go:23,cron_fill.go:34,service_queue.go:72,sql.go:230 internal database error,sql.go:230 sql: Scan error on column index 0, name "max(id)": converting NULL to int64 is unsupported
akatsuki-cron-fill | Error: internal database error
akatsuki-cron-fill | Usage:
akatsuki-cron-fill | akatsuki cron fill [flags]
akatsuki-cron-fill |
akatsuki-cron-fill | Flags:
akatsuki-cron-fill | -h, --help help for fill
akatsuki-cron-fill |
akatsuki-cron-fill | 2023-04-14T10:45:26Z FTL internal database error
akatsuki-cron-fill exited with code 1
I believe it's getting this error because the accepting type is int64 and the code is running MAX(id) on an empty table. I have changed this to use sql.NullInt64 or to return 0 on error but it still threw the error.
I have actually got this working by seeding the database with 1 entry to begin with using this code:
func (sql *SQL) GetMaxID(ctx context.Context) (int64, int, error) {
var id int64
if err := sql.db.WithContext(ctx).Model(&Anime{}).Select("COALESCE(MAX(id), 0) + 1").Row().Scan(&id); err != nil {
return 0, http.StatusInternalServerError, errors.Wrap(ctx, errors.ErrInternalDB, err)
}
return id, http.StatusOK, nil
}
I then reverted it back and it worked by bringing in 30 anime at a time.
Now i have this working other than the user interface I don't understand the app I think. is this meant to scrape the whole site 30 anime at a time?
I updated the scrape cap to 10000 to see what would happen and it's running but I feel like there is something I'm missing here.