Auto-scheduler Error: Invalid token header

Just installed Auto Scheduler but cannot schedule more than a single-pass as error given … ‘detail’: Invalid token header. No credentials provided.
I’ve trawled the software coding but can find no obvious textual error or missing lines.
I’ve included the last few lines of the log below.
Can anyone please advise the possible cause and fix?
Thanks in advance.
Sep 27 14:16:31 satnogs python[3776]: 2021-09-27 14:16:31,534 - root - INFO - Finding all passes for 179 satellites:
Sep 27 14:16:38 satnogs python[3776]: [2.8K blob data]
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,118 - auto_scheduler.satnogs_client - INFO - Requesting scheduled passes for ground station 2122
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,493 - auto_scheduler.satnogs_client - INFO - Scheduled passes for ground station 2122 retrieved!
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,500 - root - INFO - Found 0 scheduled passes between 2021-09-27 14:24:31 and 2021-09-27 15:36:31 on ground station 2122
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,509 - root - INFO - 5 passes selected out of 61, 3485 s out of 4690 s at 74.307% efficiency
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,509 - root - INFO - GS | Sch | NORAD | Start time | End time | Duration | El | Priority | Transmitter UUID | Mode | Satellite name
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,510 - root - INFO - 2122 | N | 14781 | 2021-09-27T14:27:05 | 2021-09-27T14:36:22 | 0:09:17 | 8 | 0.032000 | aBPWui23BqUhVc62nySNuQ | AFSK | UOSAT 2 (UO-11)
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,510 - root - INFO - 2122 | N | 15427 | 2021-09-27T14:49:18 | 2021-09-27T15:05:18 | 0:15:59 | 63 | 0.427000 | F8aCi2iTe83XT9TnBwrth4 | BPSK | NOAA 9
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,511 - root - INFO - 2122 | N | 39444 | 2021-09-27T15:06:09 | 2021-09-27T15:19:23 | 0:13:14 | 42 | 0.336000 | Pt4MFHSC8UFHu3aTQTLz9K | BPSK | FUNCUBE-1 (AO-73)
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,511 - root - INFO - 2122 | N | 40907 | 2021-09-27T15:23:27 | 2021-09-27T15:33:01 | 0:09:33 | 11 | 0.100222 | V76m6YW7nVsTrgCboMVHEb | CW | XW-2D
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,512 - root - INFO - 2122 | N | 40911 | 2021-09-27T15:35:15 | 2021-09-27T15:45:15 | 0:10:00 | 13 | 0.119889 | HReEBxwoWJDuuvF5CfiyET | CW | XW-2B
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,512 - root - INFO - Scheduling all unscheduled passes listed above.
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,739 - auto_scheduler.satnogs_client - ERROR - Failed to batch-schedule the passes. Reason: {‘detail’: ‘Invalid token header. No credentials provided.’}
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,740 - auto_scheduler.satnogs_client - ERROR - Fall-back to single-pass scheduling.
Sep 27 14:16:38 satnogs python[3776]: 2021-09-27 14:16:38,980 - auto_scheduler.satnogs_client - ERROR - Failed to schedule the pass at 2021-09-27 14:36:22. Reason: {‘detail’: ‘Invalid token header. No credentials provided.’}
Sep 27 14:16:39 satnogs python[3776]: 2021-09-27 14:16:39,197 - auto_scheduler.satnogs_client - ERROR - Failed to schedule the pass at 2021-09-27 15:05:18. Reason: {‘detail’: ‘Invalid token header. No credentials provided.’}
Sep 27 14:16:39 satnogs python[3776]: 2021-09-27 14:16:39,409 - auto_scheduler.satnogs_client - ERROR - Failed to schedule the pass at 2021-09-27 15:19:23. Reason: {‘detail’: ‘Invalid token header. No credentials provided.’}
Sep 27 14:16:39 satnogs python[3776]: 2021-09-27 14:16:39,626 - auto_scheduler.satnogs_client - ERROR - Failed to schedule the pass at 2021-09-27 15:33:01. Reason: {‘detail’: ‘Invalid token header. No credentials provided.’}
lines 1-53/57 94%

@m0roj this error says that you haven’t included a header with the API key in the headers of the request.

Just in case, have you followed the configuration step in librespacefoundation / SatNOGS / satnogs-auto-scheduler · GitLab? If yes please make sure that the API key in .env file is the same as the one you see in SatNOGS Network.

Thank you @fredy - problem solved.
Cause: a couple of code typos.
Scheduler working fine now, but a better LNA and BPF needed for VHF data decodes.
Any particular recommendations please?

1 Like

Hi Fredy.

Can you clarify this statement for me as I’m unable to get the satnogs-auto-scheduler running and I’m having the same issues as the gent before.
Where is the file .env located as all i can find is a folder called env but NOT the file.
I’ve been able to edit the env-dist file and add the API key but I’m still having no luck.

If yes please make sure that the API key in .env file is the same as the one you see in SatNOGS Network.

Thanks
Karl.

So i think I’ve figured it out in that.

I’ve edited the “env-dist” file and added my API Token then i had to save the file with the extension .env so ending up with “env-dist.env” and now all seems to work.

This is worded very strange to me.
(Copy the env-dist file to .env and edit this file to add your SatNOGS Network API token.)
And should read.
(Edit the env-dist file to add your SatNOGS Network API token and then save it with the extension .env
so it resembles env-dist.env)

Please correct me if I’m wrong.

Thanks
Karl.

1 Like

Hi, I think this is what is going on.

In my setup the .env file is in the same directory as the satnogs-auto-scheduler directory.

The .env file on Linux (Pi) systems is a “hidden” file, since it starts with a dot. So the file may be somewhere like (depending where you git cloned): /home/pi/satnogs-auto-scheduler/.env

That file is ignored by git, as you can see it listed in .gitignore. There wouldn’t be a satnogs-auto-scheduler/.env directory when you cloned, so perhaps that got inadvertantly created. If so, you can just remove that .env directory and replace it with an .env file with the appropriate API info.

If it is working with the file env-dist.env that is probably more coincidence than anything, it is probably parsing all the .env files in the directory (speculating on that).

I hope I’m somewhat right and this helps.

Happy hacking.

3 Likes

Exactly!

The env syllable appears in multiple different contexts here:

  • .env is the filename of the configuration file. When cloning the repository it doesn’t exists at first, and the user is supposed to create it (based on the template, see env-dist)
  • env-dist is the template for the configuration file.
  • env is most probably a folder created by python-virtualenv which contains a Python Virtual Environment

Those names are common when deploying services written in Python, but I agree that for new users with less experience they can be extremely confusing.

2 Likes

I migrated the Satnogs station with the Bullseye image and after configuring and running it, I installed Auto-Scheduler.
I configured the .env file, with the API Key of my station and I still have the error "Reason: {‘detail’: ‘Invalid token header. No credentials provided.’}, I can’t find what the error could be. I have activated the different log levels and none have helped me discover the error.
Can anyone give me some help to find the problem? Thank you so much.