Skip to content

unable to use photon on ubuntu bionic release #836

Closed

Description

@insanebaba

Hi Team,
I'm getting this error when using generated photon client


Invalid `photon.()` invocation in /home/.../server.js:15497:41

Photon binary for current platform linux-glibc-libssl1.1.0 could not be found.
Photon looked in null but couldn't find it.
Make sure to adjust the generator configuration in the schema.prisma file:
generator photon {
  provider      = "photonjs"
  binaryTargets = ["native", "linux-glibc-libssl1.1.0"]
}
Please run prisma2 generate for your changes to take effect.
Note, that by providing `native`, Photon automatically resolves `linux-glibc-libssl1.1.0`.
Read more about deploying Photon: https://github.com/prisma/prisma2/blob/master/docs/core/generators/photonjs.md

the code using photon client

 import { Photon } from '@generated/photon';

const photon = new Photon();
export async function get(req, res) {

	const respo = await photon.users.findMany();
	res.writeHead(200, {
		'Content-Type': 'application/json'
	});
	await photon.disconnect();
	res.end(JSON.stringify(respo));
}

schema:

//schema.prisma

generator photon {
  provider      = "photonjs"
  binaryTargets = ["native"]
}

datasource db {
  provider = "sqlite"
  url      = "file:dev.db"
  enabled  = true
}

model User {
  id             Int        @id
  createdAt      DateTime   @default(now())
  email          String?    @unique
  name           String
  active         Boolean    @default(true)
}

os:

Linux pcname 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Activity

  1. pantharshit00 commented on Oct 28, 2019

    @pantharshit00
    Contributor

    I am unable to reproduce this on Ubuntu 18.04 LTS Linux ubuntu-s-1vcpu-1gb-fra1-01 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

    It works as expected. Can you please make sure you have installed prisma2 using --unsafe-perm.

    npm install -g --unsafe-perm prisma2
  2. added
    bug/0-unknown
    kind/bug
    on Oct 28, 2019
  3. divyenduz commented on Jan 9, 2020

    @divyenduz

    The related --unsafe-perm issue was closed @insanebaba, I suggest that you try this again, if the problem persists, please comment here and tag me.

    I am closing this one for now 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/0-unknownkind/bugtopic: binary

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions