Deploy Preview Function Logs not available?

Hey all, I’ve found I can’t see/access functions and their logs when deploying a preview with Netlify CLI.

I deploy with netlify deploy, then go to the Netlify dashboard.

I can’t see the functions & logs from my production site, but there are no functions/logs for my Deploy Preview, which is labeled as “Deploy Preview #null

Is there another way to review logging on functions deployed via netlify cli?

Thanks!

────────────────────┐

Environment Info │
────────────────────┘

System:
OS: macOS 10.15.5
CPU: (4) x64 Intel® Core™ i5-5287U CPU @ 2.90GHz
Binaries:
Node: 12.16.2 - /usr/local/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Browsers:
Chrome: 83.0.4103.97
Firefox: 76.0.1
Safari: 13.1.1
npmGlobalPackages:
netlify-cli: 2.52.0

netlify-cli/2.52.0 darwin-x64 node-v12.16.2

Hi @question_asker, what was the exact command you used to deploy that got you a #null? Also, have you tried using --alias and see if that works to let you access your function logs. Hope that helps.

I used yarn build ; netlify deploy --prod.

I have tried using --alias, but Netlify CLI reported it’s an invalid argument?

Could you tell us the deploy ID (last characters in the path - hex string) for a deploy that you assert has functions, but no logs? We’ll want to examine in our database.

Only the latest CLI release, from 8 days ago, will have the --alias flag: https://github.com/netlify/cli/releases/tag/v2.54.0

I am having the same problem. The list of deploys says Deploy Preview #null. The site has 3 functions. Deploy ID 5efbac35adbfff01ec423650, from today.

Hi @question_asker and @Sensibleish,
I’ve done some digging in several of your deploy logs, our database logs, and our internal issue trackers.

Unfortunately, it does seem impossible at this time to view function logs of manual deploys. You are also running into another issue which is that we currently only show function information and logs for functions on the current HEAD branch. There are ongoing discussions and several open issues about this internally, but the only thing I can recommend for you to have more visibility into your functions today is to deploy from a repo.

@Sensibleish, it seems like you did switch back from deploying manually to deploying from a repo- were you able to see function logs when you did that?

Deploying via repo has always worked as expected for this project.

My intent with netlify deploy is the basic cycle of testing my code modifications before committing. It’s just more convenient and doesn’t create a messy git history.

Hey @Sensibleish,
In that case, I think testing locally would be your best bet: https://github.com/netlify/cli#functions

This does require that functions each have their own package.json, so may have to tweak your file structure from what it would be if you are deploying to Netlify.

Alternatively, you could manually deploy functions and send logging messages in the response body, but that is admittedly not a great pattern. And also probably not the way you want to spend your build minutes.

Let us know if we can help with the local functions testing.