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

error: "The 'AppId' option must be provided. (Parameter 'AppId')" #17

Closed
GustinAG opened this issue May 6, 2021 · 8 comments
Closed

Comments

@GustinAG
Copy link

GustinAG commented May 6, 2021

Hi Guys,

we have the above problem, - however we try cannot get rid of it so far.
We even tried this → https://www.nopcommerce.com/en/boards/topic/88830/api-plugin-error - but didn't help unfortunately.

Is this a known issue - with a known workaround maybe ?

image

@stepanbenes
Copy link
Owner

This seems to be related to Facebook authentication plugin. Also, this repo did not exist 5 months ago. What version of api plugin did you install?

@GustinAG
Copy link
Author

GustinAG commented May 6, 2021

Thx a lot for replying so quickly!

Also, this repo did not exist 5 months ago.

I know, - and I'm really glad that it does now :)
And I agree of course it seems to be an inherited issue from the original repo.

What version of api plugin did you install?

We installed the current one - including your last commit 3 days ago.

And sorry for not mentioning it earlier: we run the whole thing in Docker / Swarm.
(Locally, in Docker, - whereas in the Test environment, in Docker Swarm, - result is on both the same.)

@stepanbenes
Copy link
Owner

I cannot reproduce the error. Does the nopCommerce web works without an issue? Does it work when debugging locally without docker? Did you try to uninstall facebook plugin?

@GustinAG
Copy link
Author

GustinAG commented May 7, 2021

Does the nopCommerce web works without an issue?

As far as we concerned: yes.
Admin GUI for plugins doesn't, - you have to include desired plugins in Dockerfile, - however, that's by design so in Docker environment AFAIK.

Does it work when debugging locally without docker?

That part works in my colleague F1's local dev environment.
(At me the whole WIndows Docker Desktop collapsed after trying to debug - but that's another issue.)

Did you try to uninstall facebook plugin?

Yes, we tried. That didn't help.

I cannot reproduce the error.

Here's the Dockerfile we're using - eventually, that might help at reproducing....
BTW that's nop's officially recommended Dockerfile - including our additions (like API plugin) and excluding FB Auth - also, as officially recommended.

# create the build instance
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build

WORKDIR /build

COPY ./.config .

RUN dotnet tool restore

COPY ./paket.dependencies .
COPY ./paket.lock .

RUN dotnet paket restore

RUN cp -r /build/paket-files/github.com/nopSolutions/nopCommerce . \
 && cd / \
 && ln -s /build/nopCommerce/src /src

WORKDIR /src

# restore solution
RUN dotnet restore NopCommerce.sln

WORKDIR /src/Presentation/Nop.Web

# build project
RUN dotnet build Nop.Web.csproj -c Release

# build plugins
WORKDIR /src/Plugins/Nop.Plugin.DiscountRules.CustomerRoles
RUN dotnet build Nop.Plugin.DiscountRules.CustomerRoles.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.ExchangeRate.EcbExchange
RUN dotnet build Nop.Plugin.ExchangeRate.EcbExchange.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.ExternalAuth.Facebook
#RUN dotnet build Nop.Plugin.ExternalAuth.Facebook.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Misc.Sendinblue
RUN dotnet build Nop.Plugin.Misc.Sendinblue.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Payments.CheckMoneyOrder
RUN dotnet build Nop.Plugin.Payments.CheckMoneyOrder.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Payments.Manual
RUN dotnet build Nop.Plugin.Payments.Manual.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Payments.PayPalSmartPaymentButtons
RUN dotnet build Nop.Plugin.Payments.PayPalSmartPaymentButtons.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Payments.PayPalStandard
RUN dotnet build Nop.Plugin.Payments.PayPalStandard.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Pickup.PickupInStore
RUN dotnet build Nop.Plugin.Pickup.PickupInStore.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Shipping.FixedByWeightByTotal
RUN dotnet build Nop.Plugin.Shipping.FixedByWeightByTotal.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Shipping.ShipStation
RUN dotnet build Nop.Plugin.Shipping.ShipStation.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Shipping.UPS
RUN dotnet build Nop.Plugin.Shipping.UPS.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Tax.Avalara
RUN dotnet build Nop.Plugin.Tax.Avalara.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Widgets.FacebookPixel
RUN dotnet build Nop.Plugin.Widgets.FacebookPixel.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Widgets.AccessiBe
RUN dotnet build Nop.Plugin.Widgets.AccessiBe.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Tax.FixedOrByCountryStateZip
RUN dotnet build Nop.Plugin.Tax.FixedOrByCountryStateZip.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Widgets.GoogleAnalytics
RUN dotnet build Nop.Plugin.Widgets.GoogleAnalytics.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Widgets.NivoSlider
RUN dotnet build Nop.Plugin.Widgets.NivoSlider.csproj -c Release

# third party plugins
WORKDIR /build

# api-for-nopcommerce plugin
RUN mkdir -p api-for-nopcommerce \
 && cd api-for-nopcommerce \
 && cp -r /build/paket-files/github.com/stepanbenes/api-for-nopcommerce/Nop.Plugin.Api .
WORKDIR /build/api-for-nopcommerce/Nop.Plugin.Api
RUN dotnet restore Nop.Plugin.Api.csproj \
 && dotnet build Nop.Plugin.Api.csproj  -c Release

# publish project
WORKDIR /src/Presentation/Nop.Web
RUN dotnet publish Nop.Web.csproj -c Release -o /app/published

# create the runtime instance
FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine AS runtime

# add globalization support
RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

# installs required packages
RUN apk add libgdiplus --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
RUN apk add libc-dev --no-cache

# copy entrypoint script
COPY --from=build /build/nopCommerce/entrypoint.sh /entrypoint.sh
RUN chmod 755 /entrypoint.sh

WORKDIR /app
RUN mkdir bin
RUN mkdir logs

COPY --from=build /app/published .

# wait-for-it.sh dependency
RUN apk add bash --no-cache

# call entrypoint script instead of dotnet
ENTRYPOINT "/entrypoint.sh"

@stepanbenes
Copy link
Owner

I have managed to reproduce the problem. I have used similar Dockerfile with all plugins including api plugin and facebook authentication plugin and received the same error when trying to access the api. I fixed that by filling the AppId and AppSecret values of facebook plugin with some random strings. After this "fix" the api should work.

However, the swagger page was not accessible in release builds. I have commited an update to show swagger UI in Development environment. (set ASPNETCORE_ENVIRONMENT environment variable to Development).

@stepanbenes
Copy link
Owner

Closing as workaround has been provided.

@HendrikKoelbel
Copy link

Will there be an update for this workaround in the future?

@vyas-hardik
Copy link

I was getting the same error message. Then I added AppId and AppSecret in FacebookAuthenticationRegistrar.cs

Then that error was resolved but still not getting swagger page. Instead when I hit /api it is redirecting me to https://localhost:44369/page-not-found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants