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

Question: HTTP Error (400): 'offset' not supported #10

Closed
mainul2k2 opened this issue Jan 25, 2021 · 3 comments
Closed

Question: HTTP Error (400): 'offset' not supported #10

mainul2k2 opened this issue Jan 25, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@mainul2k2
Copy link

mainul2k2 commented Jan 25, 2021

HI,
Thanks for the awesome plugin.

i am using below two lines to return all printers in my controller file.

$printers = Printing::printers();
return $printers;

It does not show anything.

Then i find rawlink/laravel-printing/src/printing.php file where i pass the $e. Then i get the error [{"statusCode":"400","message":"HTTP Error (400): 'offset' not supported"}]

public function printers(): Collection
{
    try {
        $printers = $this->driver->printers();
    } catch (\Throwable $e) {
        $printers = collect([$e]);
    }
    $this->resetDriver();
    return $printers;
}

Am i doing something wrong?

@mainul2k2 mainul2k2 added the bug Something isn't working label Jan 25, 2021
@flexchar
Copy link

flexchar commented Feb 15, 2021

Same here. I installed and was presented with an empty list. I dived deep and reached PrintNode\Client. It is the source of bug. I'll see if I can come up with something meaningful.

It seems like there is a pull-request fixing this issue back in 2017. Honestly it strikes me hard how the package of a commercial product is this abandoned. PrintNode/PrintNode-PHP#20

Turns out they changed API for newly created users to use different offset string and thus why the issue arose. I created simple pull that fixes PrintNode/PrintNode-PHP#41. I also contacted them - they're planning on refreshing client libraries later this year.

@mainul2k2
Copy link
Author

@flexchar Thanks bro, perfectly working

Same here. I installed and was presented with an empty list. I dived deep and reached PrintNode\Client. It is the source of bug. I'll see if I can come up with something meaningful.

It seems like there is a pull-request fixing this issue back in 2017. Honestly it strikes me hard how the package of a commercial product is this abandoned. PrintNode/PrintNode-PHP#20

Turns out they changed API for newly created users to use different offset string and thus why the issue arose. I created simple pull that fixes PrintNode/PrintNode-PHP#41. I also contacted them - they're planning on refreshing client libraries later this year.

@tkrause
Copy link

tkrause commented Apr 14, 2021

So I'm having this same issue with the latest 1.3 version of this package.

Looking more into it, PrintNode patched this in dev-master but did not tag it. When trying to require dev-master, it doesn't work due to being locked to rc1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants